npm/pnpm/yarn切换源
npm/pnpm/yarn切换源
npm
# 查看源
npm get registry
npm config get registry
# 临时修改
npm --registry https://registry.npmmirror.com install any-touch
# 永久修改
npm config set registry https://registry.npmmirror.com
# 还原
npm config set registry https://registry.npmjs.org
NRM
# 安装 nrm
npm install -g nrm
# 列出当前可用的所有镜像源
nrm ls
# 使用淘宝镜像源
nrm use taobao
# 测试访问速度
nrm test taobao
pnpm
# 查看源
pnpm get registry
pnpm config get registry
# 临时修改
pnpm --registry https://registry.npmmirror.com install any-touch
# 永久修改
pnpm config set registry https://registry.npmmirror.com
# 还原
pnpm config set registry https://registry.npmjs.org
yarn
# 查看源
yarn config get registry
# 临时修改
yarn add any-touch@latest --registry=https://registry.npmjs.org/
# 永久修改
yarn config set registry https://registry.npmmirror.com/
# 还原
yarn config set registry https://registry.yarnpkg.com
YRM
# 安装 yrm
npm install -g yrm
# 列出当前可用的所有镜像源
yrm ls
# 使用淘宝镜像源
yrm use taobao
# 测试访问速度
yrm test taobao