我们在开发node.js的时候,经常会遇到某些包无法下载, 或者下载太慢, 还有需要加载我们自己是有源中的包的问题, 今天推荐给大家的这款 nrm 镜像源管理工具就是解决这类问题的.

安装

方法也很简单, 执行npm install nrm -g 就可以安装

# 安装nrmnpm install nrm -g# 添加源nrm add taobao https://registry.npmmirror.com/# 使用源nvrm use taobao

使用:

通过 nrm use xxx 可以切换不同的源、或者 nrm add xxx xxx域名 添加npm镜像源,可以在本地or服务器安装打包安装的时候,直接切换内部的源 在当前的私有服进行设置、当前私服找不到的话切换外网进行访问下载。

nrm lsnpm -------- 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/

这回就可以在不同的npm源中轻松方便的进行却换操作了..