npm install 失敗


配置環境時,npm install一直遇到同一個錯誤:

檢查了下log,發現npm在獲取patternfly依賴包元數據的時候總是會遭遇不可預料的文件末端

1486 silly fetchPackageMetaData error for patternfly@>=3.27.2 unexpected end of file 1487 silly pacote git manifest for components-jqueryui@github:components/jqueryui#1.12.1 fetched in 825ms 1488 silly resolveWithNewModule components-jqueryui@1.12.1 checking installable status 1489 verbose stack Error: unexpected end of file 1489 verbose stack at Gunzip.zlibOnError (zlib.js:152:15) 

稍微搜索了一下相關問題,提到可能是網絡不穩定的原因,開着VPN重試,還是不行。看到一種思路是更換國內鏡像,試了一下,搞定了。

npm config set registry https://registry.npm.taobao.org 

參考資料在這里,鑒於評論中提到的一些情況沒有配置成默認的數據源,印象中還有cnpm之類的操作,待續。

 

 

 

.


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM