原淘宝 npm 域名停止
http://npm.taobao.org 和 http://registry.npm.taobao.org 在 2022.06.30 号正式下线和停止 DNS 解析。
域名切换规则:
http://npm.taobao.org => http://npmmirror.com
http://registry.npm.taobao.org => http://registry.npmmirror.com
旧淘宝镜像
npm config set registry https://registry.npm.taobao.org
1.切换新的镜像源
npm config set registry https://registry.npmmirror.com
然后再执行以下操作查看是否成功
npm config list
查看当前镜像地址
npm config get registry
如果没安装过淘宝镜像源的,则直接安装
npm install -g cnpm --registry=https://registry.npmmirror.com
或者
2.使用cnpm
可以使用定制的 cnpm (gzip 压缩支持) 命令行工具代替默认的 npm
:
npm install -g cnpm --registry=https://registry.npmmirror.com