最佳答案
我在创建一个react-native项目时得到-bash: react-native: command not found error
。
以下是附加信息
1. brew --version
homebrew 0.9.9
2 brew info watchman
watchman `enter code here`stable 4.50
/usr/local/Cellar/watchman/4.4.0
3. brew info flow
stable 0.24.1
/usr/local/Cellar/flow/0.24.1
4. brew info node
stable 6.1.0
/usr/local/Cellar/node/6.1.0
5. npm -version
3.8.6
6. echo $PATH
/Users/Ashok/.rbenv/shims:/Users/Ashok/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
我尝试了这个链接中建议的步骤,但我仍然得到相同的错误。
我没有任何“npm"它们在解决方案中指定的目录
Ashoks-MacBook-Pro:share Ashok$ ls
aclocal doc info ruby-build zsh
autoconf emacs man systemtap
但是我发现npm文件存在于下面的位置。
/usr/local/Cellar/node/6.1.0/etc/bash_completion.d
我卸载了react-native并重新安装了它,但我仍然面临同样的问题。