首页 > 其他 > 详细

npm切换淘宝镜像源

时间:2020-03-06 20:09:47      阅读:59      评论:0      收藏:0      [点我收藏+]

npm换源

使用cnpm淘宝命令行工具

使用阿里的cnpm代替默认的npm:
npm install -g cnpm --registry=https://registry.npm.taobao.org
检测是否安装成功:
cnpm -v

npm的仓库地址换成淘宝仓库地址

单次使用

npm install --registry=https://registry.npm.taobao.org

永久使用

npm config set registry https://registry.npm.taobao.org
手动修改设置

打开.npmrc文件(C:\Program Files\nodejs\node_modules\npm\npmrc  
添加registry =https://registry.npm.taobao.org

检测是否更换成功

npm config get registry 

还原仓库地址

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

npm切换淘宝镜像源

原文:https://www.cnblogs.com/my466879168/p/12430372.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!