npm install 报错解决
程序员文章站
2022-05-29 09:12:20
...
npm安装cnpm时报各种关于package.json的解析错误,经过多次使用'npm cache clean --force'命令清除缓存再安装后最终报如下错误:
npm ERR! code EINTEGRITY
npm ERR! sha1-wgdX/nLucSeOoP89h+XCyjDZ7fg= integrity checksum failed when using sha1: wanted sha1-wgdX/nLucSeOoP89h+XCyjDZ7fg= but got sha1-Qfc3yuL3VpD7S/vTCTybJry8+uE=. (24612 bytes)
查了一翻资料应该是npm版本过低问题,于是执行'npm install -g npm'命令升级版本,然后在执行安装'npm install -g cnpm --registry=https://registry.npm.taobao.org',报错如下:
npm ERR! code EINTEGRITY
npm ERR! Verification failed while extracting [email protected]^3.6.2:
npm ERR! sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA= integrity checksum failed when using sha1: wanted sha1-m/vlRWIoYoSDjnUOrAUpWFP6HGA= but got sha512-qCYQ3agDYou0MZbXfVkt6zvzbXQxJuocoAs4MTbef1+p19dMXfu8Ep/JHMnMHs3JlxDYr9XvALnbh68pHth9UA== sha1-Q+d4hbpuN1jlIc+qNkie7y+jLw0=. (40579 bytes)
然后再执行'npm cache clean --force'清缓存再安装,再清缓存再安装.....反复几次后,终于安装成功。胜利的提示如下:
C:\Windows\System32>npm install -g cnpm --registry=https://registry.npm.taobao.org
C:\Users\lxz\AppData\Roaming\npm\cnpm -> C:\Users\lxz\AppData\Roaming\npm\node_modules\cnpm\bin\cnpm
+ [email protected]
added 778 packages from 772 contributors in 161.031s
至于为什么要反复清缓存再安装呢?我也没清楚,反正发现每次清缓存再安装报的错误都会不一样,所以反复尝试了几次就ok了 上一篇: Jupyter 笔记
下一篇: 内核dynamic_debug调试相关
推荐阅读
-
解决Pytorch dataloader时报错每个tensor维度不一样的问题
-
ORA-00845: MEMORY_TARGET not supported on this system报错解决
-
记录Idea运行程序时报错Error:Abnormal build process termination的解决方式
-
PHP加密3DES报错 Call to undefined function: mcrypt_module_open() 的解决方法,mcryptmoduleopen_PHP教程
-
phpexcel读excel有引用部分报错没有找到解决办法
-
mac下brew install 报错
-
React hooks-useEffect | 解决报错Warning...cancel all subscriptions and asynchronous tasks in a useEffect
-
undefined reference to `vtable for YAML::BadConversion' 报错的解决方法
-
android studio 3.0.1依赖butterknife报错问题解决办法以及androidstudio2.0和3.0以上butterknife的配置大全
-
ECSHOP完美解决Deprecated: preg_replace()报错的问题,ecshopdeprecated