当我过去使用 react-native run-android 运行这个应用程序时创建了 react native 应用程序之后,我收到错误,因为 root 丢失
error Option "--root" is missing. Run CLI with --verbose flag for more details. Error: Option "--root" is missing at C:\Users\Mayuri\AppData\Roaming\npm\node_modules\react-native\node_modules@react-native-community\cli\build\tools\assertRequiredOptions.js:51:13
最佳答案
如果您使用的是最新版本的 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/