npm 镜像源

发布时间:2024-03-31 18:30:00

查看镜像源

npm config get registry

npm镜像源

官方镜像源

npm config set registry https://registry.npmjs.org

淘宝镜像源

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

腾讯云镜像源

npm config set registry http://mirrors.cloud.tencent.com/npm/

华为云镜像源

npm config set registry https://mirrors.huaweicloud.com/repository/npm/


npm镜像源是npm软件包管理器的服务器地址,用于下载和安装npm包。常见的npm镜像源有以下几种:

官方源:npm官方提供的默认源,地址是https://registry.npmjs.org/,但由于位于国外,速度较慢。

淘宝源:由淘宝团队提供的镜像源,地址是https://registry.npm.taobao.org/,是国内服务器,因此速度较快。

cnpm源:另一个由淘宝团队提供的镜像源,地址是http://r.cnpmjs.org/,同样是国内服务器,速度较快。

阿里源:由阿里巴巴提供的镜像源,地址是https://npm.aliyun.com/,同样是国内服务器,速度较快。