[英]A issue occurs in the process of npm install when install the Library of ngx-admin
原因
當node.js是6.11.0,npm是3.3.0時,我嘗試npm install
前,當時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
問題
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
圖片為伙伴:在此輸入圖片說明
如你看到的:
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
我也遇到過這個錯誤:在提交票證之前請閱讀您自己的調試日志。 我看到的類似問題的一張票附有調試日志,清楚地顯示了磁盤空間不足的原因。
最終我發現我的問題實例是由陳舊的 package-lock.json 文件引起的,導致完整性檢查失敗。 .tgz 文件本身沒有任何問題(這使得錯誤消息令人沮喪地具有誤導性),它只是將完整性檢查哈希與錯誤版本的包文件存檔進行比較。 調試日志中的任何內容都沒有幫助找到實際的根本原因。
我發現以下問題(以及它的幾個副本)有助於解決這個問題: https : //github.com/npm/npm/issues/19353
僅在代理重置的幫助下,復雜的外觀問題就得到了解決。
運行以下命令並嘗試。
npm 配置 rm 代理
npm 配置 rm https-proxy
如果這會導致代理錯誤,請嘗試設置有效的代理並運行您的命令。
npm 配置設置代理http://url:port
npm 配置集 https-proxy http://url:port
npm set strict-ssl false (可選)
你應該很高興去。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.