我正在按照最新的说明05/31/2017在https://facebook.github.io/react-native/docs/getting-started.html#content上安装React Native . 我正在尝试安装react-native . 我成功安装了Homebrew,Node,Watchman但是当我尝试使用此命令安装React Native CLI时:
npm install -g react-native-cli
它给了我这个错误信息:
-bash: npm: command not found
.
然后我使用了这个命令: curl -0 -L https://npmjs.org/install.sh | sudo sh
终端给了我这个消息:enter image description here
然后我尝试运行此代码:
react-native init AwesomeProject
但收到此错误消息:
-bash: react-native: command not found
有人可以帮助我克服这个障碍,以便我可以成功安装React Native CLI吗?谢谢 .
我已经检查了以下但无济于事:
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
注意 node -v
给了我v6.10.1,但当我这样做时: npm -v
它说 -bash: npm: command not found
我以为npm带有节点 . 我可能没有npm但可以拥有nodejs吗?
1 回答
再次运行
npm install -g react-native-cli
. 您之前没有安装npm,当您运行curl语句时,安装了npm,但您现在需要安装react-native-cli .