【发布时间】:2021-11-23 19:15:57
【问题描述】:
我们在云构建过程中定期看到构建失败并出现以下错误:
docker.io/library/node:14 npm 错误! cb() 从未调用过!
npm 错误!这是 npm 本身的错误。请报告此错误 在:npm 错误! https://npm.community
构建配置的步骤:
steps:
- name: 'gcr.io/cloud-builders/git'
id: 'fetch'
entrypoint: 'bash'
args:
- '-c'
- |
# convert the shallow clone to regular one
git fetch --unshallow --no-tags
waitFor: ['-']
- name: 'node:14'
id: 'npm-install'
entrypoint: 'bash'
args:
- '-c'
- |
npm ci --unsafe-perm
env:
- 'CYPRESS_INSTALL_BINARY=0'
- 'CYPRESS_CACHE_FOLDER=/cypress_cache'
waitFor: ['fetch']
有什么想法可以尝试或解决这个问题吗?
编辑:所有包都是从 npm 安装的。
【问题讨论】:
-
什么托管 npm 注册表,从哪里安装包?
-
这种情况只是偶尔发生吗?你的 npm 和 Node 版本兼容吗?这是旧的但可能有用:stackoverflow.com/questions/15393821/…
-
@MilanTenk 所有包都来自 npmjs。
-
@JavierA 它只是偶尔发生。是的 node / npm 版本是兼容的,因为这是官方 node:14 docker 容器
-
难道没有公司代理或政策偶尔会阻止下载包吗?
标签: npm npm-install google-cloud-build