nrm 安装与使用

2019-08-14 09:53:05来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

1、安装:在命令行执行 →npm install -g nrm ,进行全局安装

2、查看可用的源:执行命令→nrm ls,如下所示, 带*号的是当前使用的源

PS E:\code> nrm ls

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

3、切换源(如切换到taobao源):执行命令→nrm use taobao,然后在进行查看,已经切换完毕

PS E:\code> nrm use taobao


   Registry has been set to: https://registry.npm.taobao.org/

PS E:\code> nrm ls

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

4、添加源:执行命令→nrm add 源名称  源路径

PS E:\code> nrm add myProject http://192.168.0.1:8080/project

    add registry myProject success

PS E:\code> nrm ls

  npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
* taobao - https://registry.npm.taobao.org/
  nj ----- https://registry.nodejitsu.com/
  npmMirror  https://skimdb.npmjs.com/registry/
  edunpm - http://registry.enpmjs.org/
  myProject  http://192.168.0.1:8080/project/

 

5、删除原:执行命令→nrm del 源名称

PS E:\code> nrm del myProject
[..................] - :
    delete registry myProject success

PS E:\code> nrm ls

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

 

6、测试源的响应时间:执行命令→nrm test 源名称

PS E:\code> nrm test npm

  npm ---- 1035ms

PS E:\code> nrm test taobao

* taobao - 149ms

 


原文链接:https://www.cnblogs.com/zhinian-/p/11088165.html
如有疑问请与原作者联系

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:浏览器 DNS缓存与DNS prefetch (DNS预解析)

下一篇:layui table表格 表头与内容列错位问题(只有纵向滚动条的情况