nrm切换npm源利器

在使用npm时,官方的源下载npm包会比较慢,国内我们基本使用淘宝的源,最近公司内部搭建了一套npm私有仓库。要添加自己公司内部的npm源,公司内部的源不可能把npm官方的npm包都全量同步,故需要npm源之间的切换,如果使用npm registry xxx的话,太不好管理了。nrm是管理npm源切换的利器。使用方法如下:
安装nrm

npm install -g nrm

nrm --help



  Commands:

    ls                           list all the registries
    current                      show current registry name
    use <registry>               change registry to registry
    add <registry> <url> [home]  add one custom registry
    del|rm <registry>            delete one custom registry
    home <registry> [browser]    open the homepage of registry with optional browser
    test [registry]              show response time for specific or all registries
    help                         print this help

  Options:

    -h, --help     output usage information
    -V, --version  output the version number

主要使用ls和use命令
1)nrm ls是列出来现在已经配置好的所有的原地址

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

2)nrm use是切换到哪个源上

nrm use npm

3)nrm add添加源
4)nrm del删除源
5)nrm test测试源的响应时间,可以作为使用哪个源的参考

原文链接:http://www.jianshu.com/p/5dd18d246281

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 在使用npm时,官方的源下载npm包会比较慢,国内我们基本使用淘宝的源,最近公司内部搭建了一套npm私有仓库。要添...
    real勾玉阅读 12,297评论 2 8
  • npm源就是下载需要依赖包的服务器地址,默认是 npm ---- https://registry.npmjs.o...
    var92阅读 2,525评论 0 1
  • 包 通过使用npm来进行基本的包管理 初始化管理 对于每个项目来说都会有自己的依赖文件这时候就需要从开始就通过np...
    花开有声是我阅读 620评论 0 1
  • 风,万里长城欲纵横。急拦住,伸手用杯盛。
    伯泽阅读 350评论 1 2
  • 飞鸟 重燃热血三千遍, 不及一朝亲成炼, 深知才德尤尚浅, 破马乘空须自谦。
    家兴star阅读 117评论 0 0