首页 > 解决方案 > 应用程序构建失败并在本机反应中出现异常,评估脚本时出现问题

问题描述

我是本机反应的新手。当我运行我的应用程序时,命令行中出现以下错误。请用适当的解决方案指导我......谢谢。

FAILURE:构建失败并出现异常。

36 秒内构建失败

错误 无法安装应用程序。确保您已设置 Android 开发环境:https ://facebook.github.io/react-native/docs/getting-started.html#android-development-environment 。使用 --verbose 标志运行 CLI 以获取更多详细信息。错误:命令失败:gradlew.bat app:installDebug -PreactNativeDevServerPort=8081 :ReactNative:Unexpected empty result of running 'node -e console.log(require('@react-native-community/cli').bin);' 命令。:ReactNative:Running 'node -e console.log(require('@react-native-community/cli').bin);' 命令失败。

标签: node.jsreact-native

解决方案


再次阅读 react-native 入门文档。好像你错过了一步。错误是说您缺少@react-native-community/cli应该在初始 react-native 环境设置期间添加的模块。


推荐阅读