安装反应原生时出现路径错误(命令未找到错误) [英] Path error while installing react-native (Command not found error)
问题描述
我正在尝试安装反应本身。我已经遵循了所有步骤: https:// facebook。 github.io/react-native/docs/getting-started.html#content
I am trying to install react-native. I have followed all the steps here:https://facebook.github.io/react-native/docs/getting-started.html#content
当我使用这个命令:
react-native newProject
得到错误:
-bash: react-native: command not found.
我认为错误的路径是这个错误的根源,但我不知道如何纠正它。我非常感谢任何帮助
I think incorrect path is the source of this error, but I don't know how to correct it. Any help is greatly appreciated
我已经看了这个问题,但无法遵循:安装未安装react-native-cli命令时出错
I have taken a look at this question but couldn't follow:Error when installed react-native-cli command not found
推荐答案
我广泛搜索了一些可能解决这个问题的错误:
I searched extensively and a few possible errors that could solve this issue is:
-
更新和升级brew(后者需要相当长的时间才能耐心)
update and upgrade brew(the latter takes quite some time so be patient)
卸载并重新安装node-npm(brew install node)
uninstall and re-install node-npm(brew install node)
重新安装npm / node后重新启动计算机,
After you re-install npm/node restart your computer,
- npm install -g react-native-cli(再次安装cli东西)
现在应该工作
我认为重新安装节点为我工作(记得重新启动系统)
I think reinstalling node worked for me(remember to reboot the system)
希望这有助于
这篇关于安装反应原生时出现路径错误(命令未找到错误)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!