0%

快速切换 NPM 源:nrm

简介

NRM(NPM registry manager)是一款 node.js 工具,它可以帮助你快速切换 NPM 下载源。

安装

1
npm install -g nrm

使用

查看源

1
2
3
4
5
6
7
8
$ 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/
skimdb -- https://skimdb.npmjs.com/registry

使用源

1
2
3
$ nrm use taobao  //switch registry to taobao

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

添加自定义源

1
nrm add <registry> <url> [home]

参考资料