【问题标题】:Error in running npx react-native CLI in Android emulator在 android 模拟器中运行 npx react-native cli 时出错
【发布时间】:2021-12-30 12:39:45
【问题描述】:

在 android 模拟器中运行 npx react-native cli 时出错 命令:npx react-native run-android

错误:在 3 秒内构建失败

at makeError (D:\TestProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:174:9)
at D:\TestProject\node_modules\@react-native-community\cli-platform-android\node_modules\execa\index.js:278:16
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async runOnAllDevices (D:\TestProject\node_modules\@react-native-community\cli-platform-android\build\commands\runAndroid\runOnAllDevices.js:109:5)
at async Command.handleAction (D:\TestProject\node_modules\@react-native-community\cli\build\index.js:192:9)

info 使用 --verbose 标志运行 CLI 以获取更多详细信息。

【问题讨论】:

    标签: android react-native android-emulator npx


    【解决方案1】:

    您可能安装了全局 react-native-cli,这会导致 react-native 二进制文件中的名称冲突。您能否通过运行 yarn global remove react-native-cli 来删除全局 react-native-cli。

    请查看此链接以了解 react-native-community https://github.com/react-native-community/cli/issues/838

    【讨论】:

      猜你喜欢
      • 2022-11-18
      • 2021-09-25
      • 2020-11-22
      • 2022-06-22
      • 2016-11-29
      • 2022-01-03
      • 1970-01-01
      • 2021-12-31
      • 1970-01-01
      相关资源
      最近更新 更多