npm 换源
npm 更换源方法
一 使用命令直接换源
1.查看当前源
1 | npm config get registry |
2.更换为淘宝源
1 | npm config set registry https://registry.npmmirror.com/ |
3.换原npm源
1 | npm config set registry https://registry.npmjs.org/ |
二 使用 nrm 管理源
1.全局安装 nrm
1 | npm install nrm -g --save |
2.查看可选源列表 带 * 表示当前源
1 | nrm ls |
3.切换源
1 | nrm use <registry> |
4.添加自定义源
1 | //registry 源名称 url 源地址 |
5.删除源
1 | // <registry>源名称 |
6.测试源速度
1 | nrm test <registry> |
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 末明!

