node加速镜像源 管理工具nrm安装使用

 

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

 

安装

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

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

使用:

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

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/ 

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

 

 

 

转 : https://blog.csdn.net/tekin_cn/article/details/135359679

 

posted @ 2024-05-17 15:57  与f  阅读(174)  评论(0编辑  收藏  举报