JavaScript 使用yrm修改镜像源

安装yrm

npm install -g yrm

列出当前可用的镜像源

# yrm 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
    skimdb -- https://skimdb.npmjs.com/registry
    yarn ----  https://registry.yarnpkg.com

切换镜像源

yrm use taobao

测试速度

yrm test taobao

全局修改镜像源

yarn config set registry https://registry.npm.taobao.org/
yarn config set registry https://registry.yarnpkg.com
# 提交到 npmjs package之前要执行
yarn config set registry http://registry.npmjs.org/
posted @ 2020-07-27 09:36  荣光无限  阅读(435)  评论(0编辑  收藏  举报