"create-react-app my-app" 无法识别

"create-react-app my-app" is not recognized

我 运行 "yarn add global react-native-cli",接着是 "yarn add react-native"。到那时,一切似乎都已正确安装。

然后我使用 "create-react-native-app my-app" 导致 "zsh: command not found: create-react-app"。

我试图在具有相同问题的其他帖子中找到相关内容,但没有找到任何接近解决我问题的内容。

有谁知道为什么命令不起作用?我应该怎么做才能创建一个新的 React 应用程序?

谢谢!

OSX 高塞拉 10.13.6

PS : 这是我想要创建的应用程序 https://medium.com/better-programming/bitcoin-ripple-ethereum-price-checker-with-react-native-redux-e9d076037092

你应该运行

npm install -g create-react-native-app

然后

create-react-native-app my-app

刚刚阅读了您发布的 link:)

我居然找到了答案,是"yarn create react-app react-native-redux-crypto-tracker"。 实际上,我故意不使用 "npm",因为我从一开始就在使用我的应用程序 "yarn"。

谢谢你的帮助。:-)

安装 React with npm install -g create-react-native-app 后,您需要使用 npx、npm 或 yarn 创建应用程序。

所以创建新应用文件夹的命令是npx create-react-app app-name-here

这个 link 到 React Github 解释了创建应用程序的所有方法:https://github.com/facebook/create-react-app