小工具知识网

当前位置: 首页 > 行业知识 > 更新npm淘宝镜像源

行业知识

更新npm淘宝镜像源

2026-10-29 15:38:34 来源:互联网转载

使���原来的registry.npm.taobao.org域名报了个错误,需要切换新的源地址。

()
// 1. 如果不确定可以先检测一下自己使用了那个镜像源npm config get registry// 2. 清理一下缓存npm cache clean --force// 3. 切换新的源地址npm config set registry https://registry.npmmirror.com

如果需要安装cnpm,则使用:

//安装cnpmnpm install -g cnpm --registry=https://registry.npmmirror.com//检测是否安装成功cnpm -v

除了淘宝的镜像,也可以选择其他镜像:

()

腾讯: http://mirrors.cloud.tencent.com/npm/

华为:https://mirrors.huaweicloud.com/repository/npm/

中科大镜像: https://registry.npmjs.org/

上一篇:服务器地址怎么填格式的?

下一篇:单方快生存服务器怎么设置?