npm安装依赖报 npm ERR! code Z_BUF_ERROR npm ERR! errno -5 npm ERR! zlib: unexpected end of file 这个错误解决方案


今天碰到了一个比较奇怪的问题,下载依赖有问题报错

npm ERR! code Z_BUF_ERROR
npm ERR! errno -5
npm ERR! zlib: unexpected end of file

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-12-26T04_21_54_001Z-debug.log

 

 

看了挺多资料,有的说是更换为cnpm,结果还是没有起作用,然后发现这步操作 

解决方案如下

1.首先清除npm 缓存

npm cache clean --force

2.接下来再试一遍;

npm install

这样就好了,说实话 我也不知道是啥情况  但是后面就真的好了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM