![](/img/trans.png)
[英]I can't create React Native project with npx: react-native: command not found
[英]can't create react-native app with npx react-native init command
每当我尝试使用 npx react-native init 命令启动一个新项目时,我都会收到以下错误:
> error Error: Command failed: yarn init -y
> Usage: yarn [options]
>
> yarn: error: no such option: -y
我有 linux mint 操作系统,当我尝试使用 expo 创建一个新的 React natove 应用程序时,一切正常。当我尝试使用 sudo 运行相同的命令时,但后来我得到了
sh:1:react-native:权限被拒绝
我有 linux mint 操作系统,当我尝试使用 expo 创建一个新的 React 本机应用程序时,一切正常。 我有 16.17.1 版本的 Node,我试图删除 React Native CLI 并重新安装它,但无法解决这个问题。 是什么导致了这个错误,我该如何解决这个问题?
好吧,在将 yarn 更新到最后一个版本后,我似乎有旧版本的 yarn 我解决了这个问题。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.