1, 修改 下载仓库为淘宝镜像
npm config set registry http://registry.npm.taobao.org/
2, 如果要发布自己的镜像需要修改回来
npm config set registry https://registry.npmjs.org/
3, 安装cnpm
npm install -g cnpm –registry=https://registry.npm.taobao.org
2022 年更新
淘宝出了新域名地址
https://registry.npmmirror.com/https://registry.npmmirror.com/
2023 年更新
或者 统计目录添加配置文件 .npmrc
# npm 配置文件
# pnpm 配置
shamefully-hoist=true
strict-peer-dependencies=false
# 众所周知原因 代理地址淘宝
registry=https://registry.npmmirror.com
版权声明:本文为adc_god原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。