在使用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. java.lang.ClassCastException: class com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider$Text

    Text的包导错了 不是:import com.sun.jersey.core.impl.provider.entity.XMLJAXBElementProvider.Text; 而是:import ...

  2. pip freeze 命令迁移模块

    问题描述:现有一个测试环境安装了脚本相关的各类模块,现需要不通过联网下载,在另一个环境配置安装相同的模块 解决方案: 在安装了python脚本相关的各类模块的测试环境里,进入到任意目录下,导出pyth ...

  3. 在线自动创建springboot工程

    https://start.spring.io/

  4. iTerm2 + oh my zsh +agnoster 打造最强Mac终端

    链接: http://www.siguoya.name/pc/home/article/256 http://www.jianshu.com/p/fabd40cf83fe http://www.jia ...

  5. Java实现类似eval()函数或exec()函数的功能

    一篇参考博客:http://www.cnblogs.com/fangwenyu/archive/2011/10/12/2209051.html 在Python中有一个exec()函数,同样在JavaS ...

  6. Go程序设计

    01 Go基础特性&独有特性

  7. Win10系列:C#应用控件基础18

    WebView控件 使用WebView控件可以在应用中添加一个简易的网页浏览器窗口,将指定地址的网页内容显示出来,并可以通过WebView控件所提供的方法.属性及事件,实现如页面导航.HTML文本解析 ...

  8. vs2013打包安装程序

    安装扩展包Visual Studio Installer VS2013下默认是没有Visual Studio Installer的,需要安装对应的扩展包: 下载地址:VS2013安装向导扩展包下载 安 ...

  9. [Go back to REDIS]

    Overview 内存中的数据结构存储系统,可以用作数据库.缓存和消息中间件. redis底层数据结构:跳跃表 [为什么选skiplist而不是red-black tree] 支持多种数据结构:Str ...

  10. ChIP-seq motif ROC 相关资料

    [怪毛匠子]独家整理 不可以转载 MEME工具 http://meme-suite.org DNA motif 搜索算法总结 http://www.bbioo.com/lifesciences/40- ...