美文网首页
npm install 失败

npm install 失败

作者: 假装会编程 | 来源:发表于2017-09-20 00:19 被阅读0次

    配置环境时,npm install一直遇到同一个错误:

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

    检查了下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之类的操作,待续。

    相关文章

      网友评论

          本文标题:npm install 失败

          本文链接:https://www.haomeiwen.com/subject/rbcnsxtx.html