I am starting to install react native. I had successfully installed homebrew, nodejs , npm. but not able to install react native
First I had tried
npm install -g react-native-cli
gives me write warning:
Missing write access to /Users/project/.npm-packages/lib/node_modules/react-native-cli
After that I had tried
sudo npm install -g react-native-cli
/Users/project/.npm-packages/bin/react-native -> /Users/project/.npm-packages/lib/node_modules/react-native-cli/index.js /Users/project/.npm-packages/lib └── react-native-cli@1.0.0
Looks like install.
After that I tried
react-native init AwesomeProject
Error : react-native: command not found
What could be the problem
Best Answer
First of all, you have to install react native globally
then it will show you the path for the react native like the following
Then you have to set the default path from the above result and execute the following command
Then reload you session/env vairables
It will work like charm!