npm 默认镜像 :https://registry.npmjs.org/
1、安装 nrm

npm install nrm --global

前端依赖nrm镜像管理工具-LMLPHP

2、查看镜像源列表

 nrm ls

前端依赖nrm镜像管理工具-LMLPHP

3、测试当前环境下,哪个镜像源速度最快。

nrm test

前端依赖nrm镜像管理工具-LMLPHP

4、 切换镜像源
npm config get registry # 查看当前镜像源
nrm use taobao # 等价于 npm config set registry https://registry.npmmirror.com
前端依赖nrm镜像管理工具-LMLPHP

5、使用 cnpm 或 yarn

npm install -g cnpm --registry=https://registry.npmmirror.com
cnpm install -g yarn
02-27 10:16