【服务器】npm配置国内镜像源

【服务器】npm配置国内镜像源

零、问题

配置Node.js的HTTPS的时候,下载不了

一、解决

这里使用的是淘宝的镜像:

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

配置之后可以验证是否成功(返回刚刚设置的地址即成功):

npm config get registry

也可以使用cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

之后就可以使用cnpm了:(安装xxx)

cnpm install xxx

二、总结

参考地址:https://blog.csdn.net/qq_39207948/article/details/79449633

原文地址:https://www.cnblogs.com/minuy/p/14160036.html