问题描述
提前感谢您的任何帮助,我一般是 Mac 新手,所以请原谅我的问题,如果它非常简单,我安装了 native-react-cli 并想打开/创建一个项目.但是我收到错误'react-native : command not found'
Thanks for any help in advance , I am new to Mac in general so please forgive my question if its very straightforward, I installed native-react-cli and wanted to open/create a project . But I get the error 'react-native : command not found'
我安装了 react-native-cli:
I install react-native-cli:
npm install -g react-native-cli
npm http GET https://registry.npmjs.org/react-native-cli
npm http 304 https://registry.npmjs.org/react-native-cli
npm WARN package.json [email protected] No README.md file found!
/usr/local/share/npm/bin/react-native -> /usr/local/share/npm/lib/node_modules/react-native-cli/index.js
[email protected] /usr/local/share/npm/lib/node_modules/react-native-cli
我尝试打开/创建一个项目:
I try to open/create a project:
react-native AwesomeProject
-bash: react-native: command not found
react-native init helloWorld
-bash: react-native: command not found
感谢您的时间,我非常感谢您的帮助
Thanks for your time , I greatly appreciate any help
推荐答案
我遇到了这个问题,只是因为我的 brew 不是最新的.
I had this issue, and it was simply due to my brew not being up to date.
我更新了 brew 并重新安装了 https 中列出的组件://facebook.github.io/react-native/docs/getting-started.html#content 又开心了.
I updated brew and re-installed the components listed at https://facebook.github.io/react-native/docs/getting-started.html#content and it was happy again.
这篇关于未找到安装的 react-native-cli 命令时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!