npm切换下载安装包的仓库

(一)直接使用npm命令切换

  1.设置使用淘宝镜像

npm config set registry  + 需要切换的仓库地址
npm config set registry https://registry.npm.taobao.org

2.查看当前资源,看是否切换成功,成功后可直接使用cnpm命令

npm config get registry

3.还原到npm仓库

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

 

posted @ 2023-03-22 17:37  土小狗  阅读(132)  评论(0编辑  收藏  举报