Reputation: 4250
I am brand new to React native, and following the instructions on the 'getting started' page I came across the following problem. I ran the npm install, however I get react-native: command not found
. I did brew install node
, and brew install watchman
and both installed without errors. Additionally I downloaded xcode from the mac app store earlier today. Any help is appreciated!
Also - I tried the solution on this SO post, however, it still isn't working.
Below is output from the terminal, as well as my .bashrc file located in ~/.
Desktop npm install -g react-native-cli
/Users/roni/.npm-global/bin/react-native -> /Users/roni/.npm-global/lib/node_modules/react-native-cli/index.js
/Users/roni/.npm-global/lib
└── [email protected]
Desktop react-native init reactNativeTest
-bash: react-native: command not found
.bashrc
source /usr/local/opt/nvm/nvm.sh
export PATH="/usr/local/share/npm/bin:$PATH"
### Added by the Bluemix CLI
source /usr/local/Bluemix/bx/bash_autocomplete
Please note I changed npm's default directory to another directory, per the npm docs on fixing npm permissions
Make a directory for global installations:
mkdir ~/.npm-global
Configure npm to use the new directory path:
npm config set prefix '~/.npm-global'
Open or create a ~/.profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
Back on the command line, update your system variables:
source ~/.profile
Upvotes: 0
Views: 1553
Reputation: 39287
Copied down from the comment:
Add ~/.npm-global/bin
to your PATH, as per the direction:
npm config set prefix '~/.npm-global'
Open or create a ~/.profile file and add this line:
export PATH=~/.npm-global/bin:$PATH
Upvotes: 2