Expo EAS构建失败:文件压缩环节出错求助
解决EAS Build压缩项目失败(Git子模块目录删除错误)
问题重现
EAS Build在压缩项目环节报错,提示无法删除临时目录中的Git子模块dict,错误信息:
Compressing project files and uploading to EAS Build. Learn more ✖ Compressing project files Failed to upload the project tarball to EAS Build Reason: Path is a directory: rm returned EISDIR (is a directory) /var/folders/rw/hkq0wjwx2813knvq6fb85ntm0000gn/T/eas-cli-nodejs/e9f44126-80be-428a-8396-e3ed8d39e6aa-shallow-clone/dict Error: build command failed.
该子模块已在.easignore中排除,此前正常运行一年,近期清理过本地缓存后出现问题,本地构建正常仅压缩环节失败。
解决方案
清理EAS CLI本地缓存,执行:
eas build:clear-cache
清理完成后重新发起构建。修复Git子模块状态:
- 先检查子模块当前状态:
git submodule status - 若输出显示子模块未初始化(前缀带
-),执行初始化操作(无需更新子模块内容):git submodule init - 若后续不再需要该子模块,可直接解除关联:
git submodule deinit -f dictrm -rf .git/modules/dict
- 先检查子模块当前状态:
强化
.easignore配置:
在文件中明确添加目录规则(末尾加斜杠确保匹配目录而非文件):dict/手动清理本地临时缓存:
删除Mac用户临时目录中EAS相关缓存(路径类似/var/folders/rw/.../eas-cli-nodejs/),重启终端后再尝试构建。
内容的提问来源于stack exchange,提问作者Torben Nordtorp
相关产品推荐
相关产品推荐

