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