0
votes

I'm following the latest instructions 05/31/2017 on installing React Native on https://facebook.github.io/react-native/docs/getting-started.html#content. I'm attempting to install react-native. I successfully installed Homebrew, Node, Watchman but when I tried installing React Native CLI with this command:

npm install -g react-native-cli

it gave me this error message:

-bash: npm: command not found.

I then used this command: curl -0 -L https://npmjs.org/install.sh | sudo sh

and the terminal gave me this message: enter image description here

I then tried running this code:

react-native init AwesomeProject

but got this error message:

-bash: react-native: command not found

can someone help me overcome this obstacle so I can successfully installing React Native CLI? Thank you.

I already checked out the following but to no avail:

Error when installed react-native-cli command not found

Path error while installing react-native (Command not found error)

-bash: react-native: command not found

** NOTE ** node -v gives me v6.10.1 but when i do this: npm -v it says -bash: npm: command not found

I thought npm came with node. Is it possible that I do not have npm but have can have nodejs?

1
@KenWhite can you explain these instructions to me: You have to make sure /usr/local/share/npm/bin is in your PATH to use binaries installed with npm. Add the following to your ~/.bashrc: export PATH="/usr/local/share/npm/bin:$PATH" And reload your shell session. this is found in the stackoverflow.com/questions/33282545/… articleSaia Fonua

1 Answers

0
votes

Run npm install -g react-native-cli again. You didn't have npm installed before, when you ran the curl statement, that installed npm, but you now need to install the react-native-cli.