打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
设置npm的registry

1.原npm地址

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

2.设置国内镜像

a.通过config命令

npm config set registry https://registry.npm.taobao.org npm info underscore (如果上面配置正确这个命令会有字符串response)

b.命令行指定

npm --registry https://registry.npm.taobao.org info underscore 

c.编辑 ~/.npmrc 加入下面内容

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

3.使用nrm管理registry地址

a.下载nrm

npm install -g nrm

b.添加registry地址

nrm add npm http://registry.npmjs.org
nrm add taobao https://registry.npm.taobao.org

c.切换npm registry地址

nrm use taobao
nrm use npm

搜索镜像: https://npm.taobao.org

建立或使用镜像,参考: https://github.com/cnpm/cnpmjs.org

转自 https://www.cnblogs.com/sghy/p/6840925.html

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
切换npm源
yarn更换淘宝镜像
nodejs下载、安装和配置
安装node
使用Sinopia搭建私有的npm仓库
npm切换淘宝源,yarn切换淘宝源
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服