Skip to content

npx react-native init failed #299

Closed
Closed

Description

@tangkunyin

Hi there, I refer to the instruction like below which was a pr has been merged #291

Focus areas to test
Testing of this change was performed using a local copy of this branch, Verdaccio to run a local npm proxy, and react-native-macos and react-native-macos-init were published to the local Verdaccio server. Then the intended usage was tested:

$ npx react-native init AwesomeApp
$ cd AwesomeApp
$ npx react-native-macos-init

After installed the verdaccio proxy and push code success
image

I tried to init my macOS app with npx, but it failed with: command not found: react-native

image

image

Activity

  1. tangkunyin commented on Apr 10, 2020

    @tangkunyin
    Author

    Since npx not work, I tried to install react-native as global:

    npm install react-native -g
    
    npm install react-native-macos-init -g
    

    After installed that, I init again:react-native init AwesomeApp && cd AwesomeApp && react-native-macos-init

    It works~

    image

  2. tom-un commented on Apr 11, 2020

    @tom-un
    Collaborator

    Hi THOMAS (@tangkunyin) : the issue is because in this fork of react-native, the package.json name is still "name": "react-native" even though it is published to npmjs.org as "react-native-macos". In the build pipeline we run a script to rename the local copy in package.json to "react-native-macos" just prior to npm publish. To work around this issue locally, you have to manually rename your local copy of package.json prior to publishing to verdaccio.

    We have this backwards internal naming for legacy reasons. I will be making a PR soon to make the name in package.json "react-native-macos" in the repo.

  3. tangkunyin commented on Apr 13, 2020

    @tangkunyin
    Author
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions