使用淘宝NPM镜像服务器解决下包慢的方案

使用淘宝NPM镜像服务器解决下包慢的方案:

1
2
3
4
5
6
7
8
#查看当前包镜像源有哪些
npm config get registry
 
#将镜像源切换为淘宝镜像源
npm config set registry=https://registry.npm.taobao.org/
 
#检查是否成功
npm config get registry

 nrm:

为了更方便的切换下包的镜像源,我们可以安装 nrm 这个小工具,利用 nrm 提供的终端命令,可以快速查看和切换包的镜像源

复制代码
#通过 npm ,将nrm安装为全局可用的工具
npm I nrm -g

#查看可用镜像源
nrm ls

#切换为淘宝镜像源
nrm use taobao
复制代码
posted @ 2022-05-08 22:36  RHCHIK  阅读(188)  评论(0编辑  收藏  举报