travis-ci - npm install 在 Travis CI 中工作,但在 GitHub Actions 中失败
问题描述
我们正在从迁移Travis CI
到GitHub Actions
. 在Travis CI
中,我们为node
存储库构建了版本。
Travis CI
配置:
dist: trusty
language: node_js
node_js:
- 6.10.3
使用此配置, InTravis CI
正在npm install
工作。
GitHub Actions
配置:
jobs:
build:
runs-on: ubuntu-20.04
steps:
- name: Setup Node.js environment
uses: actions/setup-node@v2.1.5
with:
node-version: '6.10.3'
- name: Check out repository code
uses: actions/checkout@v2.3.4
- name: script
run: |
npm install
但是在GitHub Actions
,我得到以下错误
29484 verbose correctMkdir /github/home/.npm correctMkdir not in flight; initializing
129485 verbose afterAdd /github/home/.npm/bower/1.8.2/package/package.json written
129486 silly rollbackFailedOptional Starting
129487 silly rollbackFailedOptional Finishing
129488 silly runTopLevelLifecycles Finishing
129489 silly install printInstalled
129490 verbose stack Error: ENOENT: no such file or directory, open '/tmp/npm-604-fb46bda8/registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz'
129490 verbose stack at Error (native)
129491 verbose cwd /__w/website/website
129492 error Linux 5.4.0-1047-azure
129493 error argv "/__t/node/6.10.3/x64/bin/node" "/__t/node/6.10.3/x64/bin/npm" "i"
129494 error node v6.10.3
129495 error npm v3.10.10
129496 error path /tmp/npm-604-fb46bda8/registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz
129497 error code ENOENT
129498 error errno -2
129499 error syscall open
129500 error enoent ENOENT: no such file or directory, open '/tmp/npm-604-fb46bda8/registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz'
129501 error enoent ENOENT: no such file or directory, open '/tmp/npm-604-fb46bda8/registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz'
129501 error enoent This is most likely not a problem with npm itself
129501 error enoent and is related to npm not being able to find a file.
129502 verbose exit [ -2, true ]
我尝试了以下步骤,但没有运气。
- npm 缓存清理 -f
- rm node_modules package-lock.json
到目前为止,我正在考虑OS
两个 CI 之间的区别。Travis 存在Ubuntu 14.04
和 GitHub Actions 存在Ubuntu 20.04
(我也尝试过18.04
)
有人遇到过类似的问题吗?任何解决方法的想法?
如果需要更多信息,请告诉我!
谢谢!
解决方案
推荐阅读
- google-apps-script - 收到错误“此操作会使工作表中的单元格数量超过限制”,其中包含 50,000 个单元格
- ruby-on-rails - 如何在思考狮身人面像导轨中进行多方面搜索
- angular - Angular - 找不到模块:错误:无法解析“角度”
- kubernetes - Kubectl api-resources 列出具有不同 API 组的重复资源
- python - 如何从有条件的熊猫系列中删除字符?
- json - 在树状结构中以角度显示 Jason 数据
- sql - 使用“with”子句
- vuejs2 - 如何在使用 Vuetify v.1.5 的项目中仅覆盖 Vuetifyjs v.2 中的一种样式
- excel - 循环槽细胞时获取超链接
- angular - 无法将 http 请求发布到 .Net Core 2.1 Web 项目