目录

Node.js 常见用法

常用命令

# 设置源
npm config set registry <url>

# 查看当前源
npm config get registry

设置淘宝源

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

常用镜像源

服务商 镜像地址 状态
官方 https://registry.npmjs.org 国内不稳定
阿里 https://registry.npmmirror.com 推荐
腾讯 http://mirrors.cloud.tencent.com/npm/ 可用
华为 https://mirrors.huaweicloud.com/repository/npm/ 可用