You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native构建失败:执行gradlew assembleRelease遇ExpoManifest错误

解决Expo构建Release版本时Node命令未识别的问题

报错信息:

> Task :app:createReleaseExpoManifest FAILED
'[node' is not recognized as an internal or external command,
operable program or batch file.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:createReleaseExpoManifest'.
> Process 'command 'cmd'' finished with non-zero exit value 1

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 23s
920 actionable tasks: 17 executed, 903 up-to-date

解决方案:

  • 验证Node环境变量配置
    打开cmd输入node -v,如果无法显示版本号,将Node安装目录(默认是C:\Program Files\nodejs)添加到系统PATH变量,重启cmd和IDE后再尝试构建。如果能显示版本号,继续下一步。

  • 检查Gradle配置中的语法错误
    查看项目android/app/build.gradle或根目录build.gradle里的createReleaseExpoManifest相关配置,确认是否存在类似[node的错误写法(比如变量引用时括号使用错误,应该是${node}而非[node),修正语法后重新构建。

  • 在Gradle中强制指定Node路径
    若环境变量正常但Gradle仍找不到Node,在android/build.gradle中添加Node的绝对路径配置:

    project.ext {
        node = "C:\\Program Files\\nodejs\\node.exe" // 替换为你的Node实际路径
    }
    
  • 清理Gradle缓存
    执行命令gradlew clean清空缓存,再运行gradlew assembleRelease重新构建。

  • 重新安装Node.js
    卸载现有Node,下载官方LTS版本安装包,安装时务必勾选"Add to PATH"选项,确保安装完整后再尝试构建。

内容的提问来源于stack exchange,提问作者gulshan _____

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.12 17:42:06