欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

nrm 安装与使用

程序员文章站 2022-04-29 20:33:37
1、安装:在命令行执行 →npm install -g nrm ,进行全局安装 2、查看可用的源:执行命令→nrm ls,如下所示, 带*号的是当前使用的源 PS E:\code> nrm ls * npm https://registry.npmjs.org/ cnpm http://r.cnpm ......

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