原因
我尝试npm install
前node.js是6.11.0,npm是3.3.0,那时npm没问题但问题是(元数据版本与模块不匹配... ...)稍后发生,我键入npm i npm -g
代码(https://github.com/akveo/ngx-admin/issues/1367)。因此现在npm的版本是5.6.0,最后一期是同一个版本新问题发生的时间。
环境
系统:Ubuntu14.04; Node.js的:6.12.0; NPM:5.6.0
Probloem
kris-allen@krisallen:~/ngx-admin$ npm install
npm WARN registry Unexpected warning for https://registry.npmjs.org/: Miscellaneous Warning EINTEGRITY: sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q== integrity checksum failed when using sha512: wanted sha512-WIr7iDkdmdbxu/Gh6eKEZJL6KPE74/5MEsf2whTOFNxbIoIixogroLdKYqB6FDav4Wavh/lZdzzd3b2KxIXC5Q== but got sha1-EfgjGPX+e7LNIpZaEI6TBiCCFtg=. (1837200 bytes)
npm WARN registry Using stale package data from https://registry.npmjs.org/ due to a request error during revalidation.
npm WARN tar zlib error: unexpected end of file
npm ERR! cb() never called!
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>
npm ERR! A complete log of this run can be found in:
npm ERR! /home/kris-allen/.npm/_logs/2017-11-29T19_48_56_963Z-debug.lo
作为研究员的图片: enter image description here
答案 0 :(得分:1)
我也遇到了此错误:在提交故障单之前,请先阅读您自己的调试日志。我看到的一张类似问题的票证上附有一个调试日志,清楚地显示了导致磁盘空间不足的原因。
最终,我发现问题的实例是由过时的package-lock.json文件引起的,导致完整性检查失败。 .tgz文件本身没有任何问题(这使错误消息令人沮丧地令人误解),它只是将完整性检查哈希与错误版本的软件包文件存档进行了比较。调试日志中的任何内容都无法帮助您找到真正的根本原因。
我发现以下问题(及其一些重复)对解决这一问题很有帮助: https://github.com/npm/npm/issues/19353
答案 1 :(得分:0)
如你所见:
npm ERR! This is an error with npm itself. Please report this error at:
npm ERR! <https://github.com/npm/npm/issues>
所以请使用上面提到的日志向npm本身报告此问题:
npm ERR! A complete log of this run can be found in:
npm ERR! /home/kris-allen/.npm/_logs/2017-11-29T19_48_56_963Z-debug.lo
答案 2 :(得分:0)
仅借助代理重置即可解决外观复杂的问题。
运行以下命令并尝试。
npm config rm代理
npm config rm https-proxy
如果这导致代理错误,请尝试设置有效的代理并运行命令。
npm配置集代理http://url:port
npm config set https-proxy http://url:port
npm set strict-ssl false (可选)
你应该很好。