npm镜像地址的修改或切换

方法一:直接编辑npm的配置文件
npm config edit
修改registry的地址
registry=https://registry.npm.taobao.org

方法二:用代码更改npm的配置文件
npm config set registry http://registry.npm.taobao.org
此处镜像改为淘宝镜像

方法三:使用nrm管理registry地址
安装nrm
npm install -g nrm
查看镜像列表
nrm ls
切换镜像
nrm use taobao
在nrm添加自己的镜像地址
nrm add r_name r_url(r_name镜像名字,r_url镜像地址)
删除
nrm del r_name
测试镜像的相应速度
nrm test r_name

淘宝 NPM 镜像:https://npm.taobao.org/

猜你喜欢

转载自www.cnblogs.com/Sky-Raining/p/10313600.html