【问题标题】:A issue occurs in the process of npm install when install the Library of ngx-admin安装 ngx-admin 的库时 npm install 过程中出现问题
【发布时间】:2017-11-30 02:16:59
【问题描述】:

原因

我尝试npm install之前node.js是6.11.0,npm是3.3.0,当时npm没问题但是一个问题(元数据版本与模块不匹配..... .) 稍后发生,我根据 (https://github.com/akveo/ngx-admin/issues/1367) 键入 npm i npm -g 的代码。所以现在 npm 的版本是 5.6.0,最后一个问题在新问题发生的同时得到解决。

环境

系统:Ubuntu14.04;节点.js:6.12.0; npm:5.6.0

问题

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

【问题讨论】:

  • 问题来自npm,你应该试试Yarn,产生的错误更少,速度也更快。你应该安装 yarn npmjs.com/package/yarn,谢谢

标签: node.js ubuntu npm-install ngx-bootstrap


【解决方案1】:

如你所见:

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

【讨论】:

  • 但这没什么用。我稍后再试。
  • 是的,我知道。但是阅读 npm 日志可能会有所帮助,通常它有详细的错误描述
【解决方案2】:

我也遇到过这个错误:请在提交工单之前阅读您自己的调试日志。我看到的一张类似问题的工单附有一个调试日志,清楚地显示了磁盘空间不足的原因。

最终我发现我的问题实例是由陈旧的 package-lock.json 文件引起的,导致完整性检查失败。 .tgz 文件本身没有任何问题(这使错误消息令人沮丧地误导),它只是将完整性检查哈希与错误版本的包文件存档进行比较。调试日志中的任何内容都没有帮助找到真正的根本原因。

我发现以下问题(以及其中的几个问题)有助于解决这个问题: https://github.com/npm/npm/issues/19353

【讨论】:

    【解决方案3】:

    只是在代理重置的帮助下解决了看起来很复杂的问题。

    运行以下命令并尝试。
    npm config rm proxy
    npm config rm https-proxy

    如果出现代理错误,请尝试设置有效代理并运行您的命令。
    npm config set proxy http://url:port
    npm 配置设置 https-proxy http://url:port
    npm set strict-ssl false
    (可选)

    你应该很高兴。

    【讨论】:

      猜你喜欢
      • 2021-04-11
      • 2022-07-14
      • 2014-05-24
      • 1970-01-01
      • 2015-08-21
      • 2013-07-02
      • 2018-12-05
      • 2012-09-02
      • 1970-01-01
      相关资源
      最近更新 更多