在使用npm时,官方的源下载npm包会比较慢,国内我们基本使用淘宝的源,如果公司内部搭建了一套npm私有仓库,公司内部的源不可能把npm官方的npm包都同步,所以需要切换npm源。如果使用npm/cnpm config set registry xxx来切换源的话,来回切换设置会比较麻烦。使用nrm就可以对源进行高效的管理。使用方法如下:

全局安装nrm:

npm install  nrm -g

常使用的命令包括:ls,use,add,del

1)nrm  ls。列出已经配置好的所有的源地址。

nrm ls
* npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - http://registry.npm.taobao.org/

2)nrm use。切换到指定源上。

nrm add new https://new.com

此时,会提示 :

Registry has been set to: http://r.cnpmjs.org/

再次执行nrm ls,会得到:

 npm ---- https://registry.npmjs.org/
*cnpm --- http://r.cnpmjs.org/
taobao - http://registry.npm.taobao.org/

3)add。添加一个新的源。

nrm add new https://new.com

此时提示:

add registry new success

4)del。删除一个已经存在的源

nrm del new

此时提示:

delete registry new success

其他操作,可以参考

nrm --help
Usage: nrm [options] [command]

  Commands:

    ls                           list all the registries
current show current registry name
use <registry> change registry to registry
add <registry> <url> [home] add one custom registry
del|rm <registry> delete one custom registry
home <registry> [browser] open the homepage of registry with optional browser
test [registry] show response time for specific or all registries
help print this help Options: -h, --help output usage information
-V, --version output the version number

希望大家有更好的工具可以分享。

使用nrm工具高效地管理npm源的更多相关文章

  1. nrm管理npm源

    npm源:npm install命令下载需要依赖包的服务器地址,默认是 npm ---- https://registry.npmjs.org/ 而国外的源速度太慢,所以我们一般都用国内的淘宝源tao ...

  2. Node: 使用nrm管理npm源

    一.简介 npm是一款非常好用的包管理工具,在前端开发中很多时候都会使用npm安装其他包文件.但是,npm安装某些包时有时会安装地很慢,这是因为npm管理的源中有些是国外的,包下载的时候需要花费很多时 ...

  3. nrm安装与配置(nrm管理npm源)

    1.nrm nrm(npm registry manager )是npm的镜像源管理工具,有时候国外资源太慢,使用这个就可以快速地在 npm 源间切换 2.安装nrm 在命令行执行命令,npm ins ...

  4. 管理npm源命令

    nrm ls 查看源镜像 nrm add 自定义名称 源地址 nrm use 自定义名称

  5. nrm npm源管理利器

    nrm npm源管理利器 nrm是管理npm源的一个利器. 有时候我们用npm install 安装依赖时会非常的慢,是官方自身的npm本来就慢,然后我们会尝试安装淘宝的npm或者cnpm,这些安装切 ...

  6. npm源管理

    1. 安装淘宝镜像 为了提高npm的安装速度,可以使用淘宝镜像. 使用淘宝镜像的方法有两种: 1. npm install -g cnpm --registry=https://registry.np ...

  7. 切换npm源的几种方法

    我们在使用官方提供的npm源安装各种依赖包的时候,下载速度会很慢,通常需要更换npm源. 我们可以在终端中输入命令 npm config list 来查看 npm 源地址,默认地址为 metrics- ...

  8. nrm NPM源管理工具

    nrm NPM源管理工具 工具 前端 npm cnpm 今天经过同事介绍,发现一个好玩的东西——nrm(NPM registry manager) nrm 是一个可以快速切换NPM源的node插件.由 ...

  9. NPM 源的管理器nrm

    作为一个 NPM 源管理器,nrm允许快速地在如下 NPM 源间切换: 列表项目 npm cnpm strongloop enropean australia nodejitsu taobao Ins ...

随机推荐

  1. RDP服务开启

    一.RDP协议概述 远程桌面协议(RDP, Remote Desktop Protocol)是一个多通道(multi-channel)的协议,让用户(客户端或称“本地电脑”)连上提供微软终端机服务的电 ...

  2. weex playGround 扫码空白问题

    首先安装 weex debug 用 weex debug调试可以看到报错 我做的demo扫码扫不出来  是因为:class的原因 weex中:class只支持数组形式  或者  换成:style就可以 ...

  3. vue中关于v-for性能优化---track-by属性

    vue中关于v-for性能优化---track-by属性 最近看了一些react,angular,Vue三者的对比文章,对比来说Vue比较突出的是轻量级与易上手. 对比Vue与angular,Vue有 ...

  4. Nginx配置中的log_format用法梳理(设置详细的日志格式)

    nginx服务器日志相关指令主要有两条:一条是log_format,用来设置日志格式:另外一条是access_log,用来指定日志文件的存放路径.格式和缓存大小,可以参加ngx_http_log_mo ...

  5. Spring Security Oauth2 单点登录案例实现和执行流程剖析

    Spring Security Oauth2 OAuth是一个关于授权的开放网络标准,在全世界得到的广泛的应用,目前是2.0的版本.OAuth2在“客户端”与“服务提供商”之间,设置了一个授权层(au ...

  6. asp.net 网页跳转的几种常用方法

    Response.Redirect("http://www.baidu.com",false); 后面的bool值为是否停止执行当前页.跳转向新的页面,原窗口被代替.浏览器中的UR ...

  7. SpringBoot(三)thymeleaf+JPA+MySql

    接着上一节的 第一步:在pom文件中加入以下代码: <!--JPA--> <dependency> <groupId>org.springframework.boo ...

  8. Python 测试多进程的时间

    import time from multiprocessing import Process def f1(): time.sleep(2) print("子进程1号") def ...

  9. 【转载】 TensorflowOnSpark:1)Standalone集群初体验

    原文地址: https://blog.csdn.net/jiangpeng59/article/details/72867368 作者:PJ-Javis 来源:CSDN --------------- ...

  10. mac出现zsh: command not found: ping解决方法

    Step1:终端输入以下命令: /sbin/ping 若出现如下信息,说明包含ping命令,是zsh的 PATH有问题,表示没有加载sbin下的命令,需要编辑.zshrc文件. Step2:终端打开. ...