npm使用国内淘宝镜像的方法

一. 通过命令配置

  1. 命令
npm config set registry https://registry.npm.taobao.org
  1. 验证命令
npm config get registry

如果返回 https://registry.npm.taobao.org,说明镜像配置成功。

二、通过使用 cnpm 安装

  1. 安装 cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
  1. 使用 cnpm
cnpm install xxx
posted @ 2021-11-26 17:44  寒小韩  阅读(559)  评论(0编辑  收藏  举报