我在关注安装React Native https://facebook.github.io/react-native/docs/getting-started.html#content的最新说明05/31/2017。 我正在尝试安装react-native。我成功安装自制软件,节点,看守员,但是当我尝试安装阵营本地CLI使用此命令:在Mac上安装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?
[为什么“有人可以帮我吗?”不是一个实际的问题?](https://meta.stackoverflow.com/q/284236/62576) –
可能重复[错误时安装react-native-cli命令未找到](https://stackoverflow.com/questions/29767729/error-when-installed-react-native-cli-command-not-found)和[安装react-native时出现路径错误(Command not found error)](https://stackoverflow.com/q/32253981/ 62576)和[-bash:react-native:命令未找到错误](https://stackoverflow.com/q/33282545/62576) –
@KenWhite您能否向我解释这些说明:您必须确保/ usr/local/share/npm/bin在您的PATH中使用npm安装的二进制文件。 将以下内容添加到〜/ .bashrc中: export PATH =“/ usr/local/share/npm/bin:$ PATH” 然后重新加载shell会话。 这在https:// stackoverflow中找到。com/questions/33282545/bash-react-native-command-not-found文章 –