0

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?

3

1 Answer 1

0

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.

Sign up to request clarification or add additional context in comments.

3 Comments

Trying closing your console and reopening it, then run npm -v to see if you've got npm. If it doesn't return an error, run your sudo nm install -g react-native-cli. If that doesn't error, then run your react-native init AwesomeProject
that's weird. I have node v6.10.1. But when I check for npm -v it says -bash: npm: command not found. I thought npm came with NodeJs. @Greg Billetdeaux
Looks like it didn't properly get hooked up to your PATH variable? Make sure you properly installed node, and maybe try doing it again.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.