Expo EAS Android构建突发失败:yarn安装依赖报错
Expo EAS Android构建失败(依赖安装阶段报错)
问题现象
- 此前构建正常,未修改
package.json,本地项目可正常运行 - EAS构建在
yarn install环节失败,核心错误:/home/expo/workingdir/build/node_modules/babel-plugin-react-compiler执行./scripts/link-react-compiler-runtime.sh命令失败,提示文件未找到,退出码127
解决方案
清理本地依赖缓存并重新生成lock文件
执行以下命令后提交yarn.lock到仓库,重新触发构建:yarn cache clean rm -rf node_modules rm yarn.lock yarn install原理:远程构建环境可能拉取到损坏的依赖缓存,本地重新生成lock文件可确保依赖包完整性。
锁定
babel-plugin-react-compiler稳定版本
该插件部分版本存在脚本缺失的已知问题,尝试降级/升级到验证过的稳定版本:yarn add babel-plugin-react-compiler@0.0.0-experimental-938cd75-20240522跳过插件的postinstall自动脚本
在package.json中添加配置,禁用该插件的安装后脚本:"resolutions": { "babel-plugin-react-compiler/postinstall": "echo 'Skipping postinstall script'" }统一构建环境Node.js版本
在eas.json中指定与本地一致的Node版本,避免环境差异导致依赖安装异常:"build": { "production": { "node": "20.x" } }
内容的提问来源于stack exchange,提问作者sharif2008
相关产品推荐
相关产品推荐

