npm 源管理 nrm的使用,私有源的管理

4 篇文章 0 订阅

npm 有许多镜像,不同地区访问不同的镜像速度可能有差异,然后各个镜像各自都可能有少数包暂时没有同步,因此,有时候需要切换 NPM 镜像。相比每次切换时都手动指定相应参数,使用nrm 要方便的多。
作为国内良心互联网家,taobao为国内互联网从业人员做了一件好事,就是同步npm的镜像。大大方便了工作的需求,降低网络差造成的不爽情节。
nrm 是一个 NPM 源管理器,允许你快速地在如下 NPM 源间切换:
#安装
npm install nrm -g
#使用
##列出可选源
nrm ls

  npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npm.taobao.org/
  nj ----- https://registry.nodejitsu.com/
  rednpm - http://registry.mirror.cqupt.edu.cn/
  npmMirror  https://skimdb.npmjs.com/registry/
  edunpm - http://registry.enpmjs.org/

带*号的是正在使用的源。
##切换
nrm use npm

Registry has been set to: https://registry.npmjs.org/

##增加源
你可以增加定制的源,特别适用于添加企业内部的私有源。私有源可以使用cnpmjs架设。

nrm add  dtLee  https://xxxxxx     //nrm add   自定义源名称   源地址

##删除源

[xml]
nrm del <registry>

##测试速度
nrm test npm
##测试所有
nrm test

* npm ---- 2151ms
  cnpm --- 335ms
  taobao - 472ms
  nj ----- Fetch Error
  rednpm - 194ms
  npmMirror  1145ms
  edunpm - Fetch Error
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值