镜像站点
阿里云官方镜像站:https://developer.aliyun.com/mirror/
网易开源镜像站:http://mirrors.163.com/
清华大学开源软件镜像站:https://mirrors.tuna.tsinghua.edu.cn/
北京大学开源软件镜像站:http://mirrors.pku.edu.cn/Mirrors
华中科技大学开源镜像站:http://mirrors.hust.edu.cn/
中国科学技术大学Mirror:https://chinanet.mirrors.ustc.edu.cn/
npm源镜像
淘宝 NPM 镜像:http://registry.npmmirror.com
腾讯云 NPM 镜像:https://mirrors.cloud.tencent.com/npm/ 或 https://mirrors.tencent.com/npm/
cnpm是一个基于npm的中国镜像源,地址为 https://r.cnpmjs.org/
相关命令:
npm:
查看镜像源:npm get registry
设置镜像源:npm config set registry https://registry.npmmirror.com
yarn:
查看镜像源:yarn config get registry
设置镜像源:yarn config set registry https://registry.npmmirror.com/
pnpm:
查看镜像源:pnpm config get registry
设置镜像源:pnpm config set registry https://registry.npmmirror.com/
nrm 镜像源管理工具
nrm 全称为 npm registry manager,旨在帮助用户管理不同的镜像源,基本命令如下:
安装:nrm npm install nrm -g
镜像源列表: nrm ls
添加新镜像源: nrm add <registry-name> <registry-url>
删除镜像源: nrm del <registry-name>
切换镜像源: nrm use <registry-name>
测试所有镜像源速度: nrm test