欢迎光临
感受代码之美

如何修改npm镜像源为国内镜像?

由于国内网络原因,使用npm官方镜像速度感人,可以通过切换镜像为国内源来进行加速。

1.查看当前镜像

PS E:\japp> npm config get registry
https://registry.npmjs.org/

2.安装nrm

PS E:\japp> npm install -g nrm

3.查看可用镜像源

PS E:\japp> 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/

4.切换为taobao

PS E:\japp> nrm use taobao


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

PS E:\japp> npm config get registry
https://registry.npm.taobao.org/
赞(0)
未经允许禁止转载:四个空格 » 如何修改npm镜像源为国内镜像?

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址