NPM 切换仓库

2017-07-12  本文已影响0人  Super7

安装

npm i -g nrm

列出可选的源

 nrm ls

* npm ---- https://registry.npmjs.org/
  cnpm --- http://r.cnpmjs.org/
  taobao - https://registry.npm.taobao.org/
  nj ----- https://registry.nodejitsu.com/
  rednpm - http://registry.mirror.cqupt.edu.cn/
  npmMirror  https://skimdb.npmjs.com/registry/
  edunpm - http://registry.enpmjs.org/
带*的是当前使用的源,上面的输出表明当前源是官方源。

测试所有源的响应时间:

nrm test

* npm ---- Fetch Error
  cnpm --- 382ms
  taobao - Fetch Error
  nj ----- Fetch Error
  rednpm - 1383ms
  npmMirror  Fetch Error
  edunpm - 5470ms

切换到edunpm

nrm use edunpm
Registry has been set to: http://registry.enpmjs.org/

查看当前源

npm config get registry
换
npm config set registry http://registry.enpmjs.org/

上一篇 下一篇

猜你喜欢

热点阅读