0
votes
$ react-native -v 

-bash: react-native: command not found

$ brew --version
Homebrew 2.1.0
Homebrew/homebrew-core (git revision c2b3; last commit 2019-04-14)
Homebrew/homebrew-cask (git revision 8953; last commit 2019-04-14)

$ which node
/usr/local/bin/node

$ ls -l $(which node)
lrwxr-xr-x  1 kishore  admin  31 Apr 14 11:17 /usr/local/bin/node -> ../Cellar/node/11.14.0/bin/node

$ echo $PATH

/usr/local/share/npm/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/openssl/bin:/usr/local/opt/sqlite/bin:/usr/local/opt/openssl/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/opt/icu4c/sbin:/usr/local/opt/icu4c/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I tried below suggestions already and no luck: react-native: command not found

Error when installed react-native-cli command not found

react-native not found + mac os

-bash: react-native: command not found

Please help, I am new to React-Native. I was able to build project and after brew update I am stuck with this and unable to proceed further.

2

2 Answers

0
votes

In the official docs there is a Getting Started guide with a section on the React Native CLI. The command to install it is:

npm install -g react-native-cli

It also includes additional info in case that command fails:

If you get an error like Cannot find module 'npmlog', try installing npm directly: curl -0 -L https://npmjs.org/install.sh | sudo sh.

0
votes

I followed

http://rkulla.blogspot.com/2014/03/the-path-to-homebrew.html

to setup correct $PATH for node and then

npm install -g react-native-cli

Path and reinstall RN cli helped to setup correct path on mac and resolved.

Also worth spending time watching the video helped me understand more on NPM install and how to setup Access on Mac

https://www.youtube.com/watch?v=bxvybxYFq2o&list=PLgSF2JABRs0H-bH6GJ1IJ26jaRrPGDuvf