0
votes

I am trying to install react-native. I have followed all the steps here:https://facebook.github.io/react-native/docs/getting-started.html#content

When I use this command :

react-native newProject

I am getting error as:

-bash: react-native: command not found.

I think incorrect path is the source of this error, but I don't know how to correct it. Any help is greatly appreciated

I have taken a look at this question but couldn't follow:Error when installed react-native-cli command not found

1
Have you installed react-native using the -g option?Lukas
yes i have installed with the -g optionL887
Did you install any of the components (homebrew, io.js, nvm, react-native) with sudo / su?Lukas

1 Answers

1
votes

I searched extensively and a few possible errors that could solve this issue is:

  1. update and upgrade brew(the latter takes quite some time so be patient)

  2. uninstall and re-install node-npm(brew install node)

After you re-install npm/node restart your computer,

  1. npm install -g react-native-cli (install the cli stuff again now)

Now it should work

I think reinstalling node worked for me(remember to reboot the system)

Hope this helps