npm设置成淘宝镜像

1.淘宝 npm 网址

https://npm.taobao.org/

 

2.修改

2.1 通过命令配置

2.1.1. 命令

npm config set registry https://registry.npm.taobao.org
2.1.2. 验证命令

npm config get registry
如果返回https://registry.npm.taobao.org,说明镜像配置成功。

 

2.2 通过使用cnpm安装

2.2.1  安装cnpm

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

cnpm install xxx

 

3.还原

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

 

posted @ 2019-03-20 15:55  清风柠檬  阅读(1220)  评论(0编辑  收藏  举报