react-native: command not found
Make sure that /usr/local/share/npm/bin
is in your PATH to use binaries installed with npm
Add the following line to your ~/.bashrc
export PATH="/usr/local/share/npm/bin:$PATH"
Then reload your shell session and try that again
sudo yarn global add expo-cli
sudo yarn global add react-native-cli
You must use sudo
here.
First of all, you have to install react native globally
npm install -g react-native-cli
then it will show you the path for the react native like the following
/Users/{yourUser}/.npm-packages/bin/react-native -> /Users/{yourUser}/.npm-packages/lib/node_modules/react-native-cli/index.js
Then you have to set the default path from the above result and execute the following command
export PATH="/Users/{yourUser}/.npm-packages/bin/:$PATH"
Then reload you session/env vairables
source ~/.bash_profile
It will work like charm!