项目没有包相关的变动,再跑流水线时候,执行npm ci
报错:
npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting [email protected]:
npm ERR! Verification failed while extracting [email protected]:
npm ERR! sha1-9B3LGvJYKvNpLaNvxVy9jhBBxCY= integrity checksum failed when using sha1: wanted sha1-9B3LGvJYKvNpLaNvxVy9jhBBxCY= but got sha512-+ux3lx6peh0BpvY0JebGyZoiR4D+oYzdPZMKJwkZ+sFkNJzpL7tXc/wehS49gUAxg3tmMHPHZkA8JU2rhhgDHw== sha1-Z79X9HWPAu3oj7KhcS/vTRU1i+M=. (649719 bytes)
npm WARN tarball tarball data for [email protected] (sha1-P17WZYPM1vQAtaANtvfoYTY+OI8=) seems to be corrupted. Trying one more time.
npm WARN tarball tarball data for [email protected] (sha1-P17WZYPM1vQAtaANtvfoYTY+OI8=) seems to be corrupted. Trying one more time.
package-lock.json 片段:
"fsevents": {
"version": "1.2.4",
"resolved": "http://registry.npm.taobao.org/fsevents/download/fsevents-1.2.4.tgz",
"integrity": "sha1-9B3LGvJYKvNpLaNvxVy9jhBBxCY=",
"optional": true,
"requires": {
"nan": "^2.9.2",
"node-pre-gyp": "^0.10.0"
},
"dependencies": {
"abbrev": {
"version": "1.1.1",
"bundled": true,
从 resolved 地址下载下来,用 sha1+base64 计算后,和 integrity 是一致的。 看网上有人说网络问题也会导致 integrity 不一致,但是我手动下载包挺快的,难道我手动从 resolved 地址下载,和 npm 的下载机制不一样?
直接删掉 package-lock.json ,装新版本倒是可以,但是项目太老了,严重依赖这个版本 package-lock.json ,更新后会出现一堆别的问题。以前遇到过类似的情况,等个几天,传说中的网络情况好转后就正常了。关键不懂 npm 的机制,不太懂是哪到哪的网络不稳定。
1
Corolin 2023-08-23 18:07:58 +08:00
忘了 node 的版本对这个有没有影响了
|
4
sputnick530L 2023-09-01 14:35:46 +08:00
差不多上周 gitlab 的流水线也遇到这个问题,当时还以为是网络问题,今天才发现那之后所有都没跑通,然后本地 npm install 了一下,发现提示到这里看原因 https://github.com/advisories/GHSA-xv2f-5jw4-v95m , 说由于第三方回收了过期的云存储资源,fsevents v1.0.0 <= v1.2.10 下载的二进制可执行文件包含意外代码,建议升级到 1.2.x ,具体的我比较菜,也不太懂,希望有帮助^ ^
|