Featured image of post npm换源

npm换源

换源

更换npm源地址

1
npm config set registry https://registry.npmmirror.com

其他可选npm源

1
2
3
4
5
6
# 腾讯云
http://mirrors.cloud.tencent.com/npm/
# 南京邮电大学
https://mirrors.njupt.edu.cn/nexus/repository/npm/
# 浙江大学
https://mirrors.zju.edu.cn/npm/

检查npm原地址

1
npm config get registry 

出现错误

1
npm info retry will retry, error on last attempt: Error: CERT_UNTRUSTED

解决方法

1
npm config set strict-ssl false

cnpm代替npm

1
npm install -g cnpm --registry=https://registry.npmmirror.com

更新记录

  • 2022-02-11
    1. 淘宝 NPM 镜像老域名(*.npm.taobao.org)将在 2022.06.30 号正式下线和停止 DNS 解析。切换到新域名(*.npmmirror.com
    2. 添加其他可选镜像
comments powered by Disqus
Built with Hugo
Theme Stack designed by Jimmy