前端 node.js npm使用国内淘宝镜像的方法(最新) - cnpm install xxx

📅 2026-11-30 👤 拼多多助力营销技巧 📂 手赚APP 👁️ 191 次阅读

一、通过命令配置

1、设置淘宝镜像源

//旧

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

//新

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

旧域名将在 2022.06.30 号正式下线和停止 DNS 解析

2、设置官方镜像源

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

3、查看镜像使用状态:

npm config get registry

二、通过使用cnpm安装

1、安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

解决安装卡顿或无法安装: 拼多多帮助力入口

# 注册模块镜像

npm set registry https://registry.npm.taobao.org

// node-gyp 编译依赖的 node 源码镜像

npm set disturl https://npm.taobao.org/dist

// 清空缓存

npm cache clean --force

// 安装cnpm

npm install -g cnpm --registry=https://registry.npm.taobao.org

2、使用cnpm

cnpm install xxx

精彩内容

标签: 拼多多助力网站平台 赚钱项目 拼多多助力网 首码项目 手赚APP
拼多多助力营销技巧