npm 镜像地址更改
2024-08-21 08:07:48一. 目的
npm 源网址是国外的,依赖包下载速度慢,为了提高下载速度,可以更改国内 npm 镜像地址。
二. 查看当前镜像地址
npm config get registry
三. 更改 npm 镜像地址
npm config set registry https://registry.npmmirror.com/
更改完成后,可以通过 npm config get registry
查看下当前镜像地址,是否已经更新成功。
四. 常用的 npm 镜像地址
1. 官网镜像
https://registry.npmjs.org/
2. 淘宝镜像
https://registry.npmmirror.com/ (新的)
https://registry.npm.taobao.org/ (旧的)
3. cnpm镜像
https://r.cnpmjs.org/