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

.

猜你喜欢

转载自www.cnblogs.com/jianxian/p/10624844.html