NPM镜像源查看和切换


一、镜像源链接切换

  1. 全局切换镜像源:
npm config set registry http://registry.npm.taobao.org
  1. 查看镜像源使用状态:
npm get registry
  1. 全局切换官方镜像源:
npm config set registry http://www.npmjs.org

二、使用 nrm 切换镜像源

  1. 下载 nrm:

    npm install -g nrm
  2. 查看可切换的镜像源: 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/
  3. 切换淘宝镜像源:

    nrm use taobao

文章作者: 烦恼范特西
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 烦恼范特西 !
评论
  目录