gpt4 book ai didi

react-native - 运行应用程序时 react native (root 丢失)

转载 作者:行者123 更新时间:2023-12-04 03:36:42 27 4
gpt4 key购买 nike

当我过去使用 react-native run-android 运行这个应用程序时创建了 react native 应用程序之后,我收到错误,因为 root 丢失

error Option "--root" is missing. Run CLI with --verbose flag for moredetails. Error: Option "--root" is missingat C:\Users\Mayuri\AppData\Roaming\npm\node_modules\react-native\node_modules@react-native-community\cli\build\tools\assertRequiredOptions.js:51:13


enter image description here

最佳答案

如果您使用的是最新版本的 react-native 64 并且 npm 大于 5.2,则需要使用 npx 命令执行包,而不是运行

react-native run-android 
npx react-native run-android

关于react-native - 运行应用程序时 react native (root 丢失),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66763925/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com