I get this error when trying to build any (new or old) project. My node is on version 4.2.1 and react-native is on version 0.1.7. I've looked at other people with the same problem so I've updated react-native to the latest version however I still cannot build any project through xcode.
Why am I seeing “command not found: react-native”? If you are getting this error, it means that either you do not have the CLI installed on your machine, or you do not have it configured properly.
I've faced the following error when I want to start the IOS app with the "react-native run-ios" command. If I start the debug build from XCode, it is started successfully. Run unset npm_config_prefix to unset it. Run unset npm_config_prefix to unset it.
Running your React Native application Install the Expo Go app on your iOS or Android phone and connect to the same wireless network as your computer. On Android, use the Expo Go app to scan the QR code from your terminal to open your project. On iOS, use the built-in QR code scanner of the default iOS Camera app.
If you are using RN 0.46 or above:
There is a breaking change made by Facebook: the location of the script has been changed, more detail here
I was able to solve this error by:
Build Phases > Bundle React Native code and images
export NODE_BINARY=node
../node_modules/react-native/packager/react-native-xcode.sh
to export NODE_BINARY=node
../node_modules/react-native/scripts/react-native-xcode.sh
Notice how packager
is now scripts
, which is where that file actually lives in latest version of RN
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With