Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

npx react-native init failed #299

Closed
tangkunyin opened this issue Apr 10, 2020 · 3 comments
Closed

npx react-native init failed #299

tangkunyin opened this issue Apr 10, 2020 · 3 comments
Assignees

Comments

@tangkunyin
Copy link

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

@tangkunyin
Copy link
Author

tangkunyin commented Apr 10, 2020

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

@tom-un
Copy link
Collaborator

tom-un commented Apr 11, 2020

Hi @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.

@tom-un tom-un self-assigned this Apr 11, 2020
@tangkunyin
Copy link
Author

@tom-un Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants