react-native: command not found
See original GitHub issueI’ve bootstrapped a new react-native project with the latest react-native-cli and when I try to run it in XCode, I get:
../node_modules/react-native/packager/react-native-xcode.sh: line 36: react-native: command not found
That means I can not anymore run a react-native 0.14 app in my system.
So if I understand this correctly, XCode is calling a shell script. But I’m using nvm and my react-native
is not global (unless executing some env files), so I guess xcode don’t execute my env? Also i’m using ZSH.
I feel that the packager should not expect react-native
command to exist because it really depend on the env config of each developer and we will likely have a lot of issues like this.
Why is there a strong dependency from react-native packager to react-native-cli ? Someone that fork a react-native example/project should be able to just run it without having to install react-native-cli separately
Workaround: create a
~/.profile
that setup the environment and add. ~/.profile
at the beginning of./node_modules/react-native/packager/react-native-xcode.sh
… Unfortunately I don’t see a way to setup this in XCode.
Issue Analytics
- State:
- Created 8 years ago
- Comments:54 (9 by maintainers)
Try to do this:
$ npm install -g react-native-cli
This fixed my issueI came up with the following simple solution:
ls /Users/kris/npm
I confirm there is a
/bin
folder with thereact-native
binary inside…I then manually added
/Users/kris/npm/bin
to my$PATH
export PATH=$PATH:/usr/local/bin/:/Users/kris/npm/bin
IT WORKS!!!