3. 如何管理本地多个npm镜像源

使用nrm管理镜像:
全局安装:

npm install nrm -g --save

用nrm ls命令查看默认配置

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/

也可以直接输入以下命令查看当前使用的是哪个源

nrm current

切换源

nrm use cnpm

用nrm add 命令添加公司私有npm源

nrm add xxxx https://xxxx.xx.xx.com/

测试下速度

nrm test npm
image.png
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 此文列出常见npm命令,大家共勉。1、查看npm源地址npm config list 结果:metrics-reg...
    gavinfxd阅读 582评论 0 0
  • 此文列出常见npm命令,大家共勉。1、查看npm源地址npm config list 结果:metrics-reg...
    四月天__阅读 56,235评论 3 20
  • 1、查看npm源地址 npm config list 结果:metrics-registry = "http://...
    姜yd阅读 670评论 0 0
  • 此文列出常见npm命令,大家共勉。 1.查看npm源地址 结果: 2.修改registry地址,比如修改为淘宝镜像...
    zhmbo阅读 429评论 0 0
  • 什么是nrm呢? nrm是npm的镜像源管理工具,有时候国外资源太慢,使用这个就可以快速地在 npm 源间切换。首...
    左左front阅读 1,386评论 0 0