NRM使用和安装

1.介绍NRM

nrm(npm registry manager )是npm的镜像源管理工具,有时候国外资源太慢,那么我们可以用这个来切换镜像源

2.安装NRM

# 将nrm安装到全局
npm install -g nrm

3.使用NRM

查看镜像源 nrm ls

npm -------- https://registry.npmjs.org/
 yarn ------- https://registry.yarnpkg.com/
 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/

*” 表示为选中的镜像源

切换镜像源 nrm use 镜像名

比如切换到淘宝镜像源

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

添加镜像源 nrm add 镜像名 镜像源地址

$ nrm add registry http://registry.npm.frp.trmap.cn/
add registry registry success

删除镜像源 nrm del 镜像名

$ nrm del registry
delete registry registry success

镜像源测速 nrm test 镜像名

$ nrm test taobao
taobao - 225ms