来回自如的切换淘宝镜像与国外源

来回自如的切换淘宝镜像与国外源
1.打开cmd,查看当前镜像地址:

npm get registry

2.切换为淘宝镜像:

npm config set registry http://registry.npm.taobao.org/

3.切换为原本的npm镜像:

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

用nrm管理包

1、先安装nrm 使用npm i nrm -g命令

npm i nrm -g

2、如果想切换不同的镜像地址,换快的网络,使用nrm use …命令,然后再用nrm ls查看,测试各个资源地址的速度用nrm test npm

nrm use cnpm
nrm ls
nrm test npm
posted @ 2022-01-11 14:16  SultanST  阅读(59)  评论(0编辑  收藏  举报