npm使用国内淘宝镜像

一、命令配置

1、设置淘宝镜像源

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

2、查看镜像使用状态

npm config get registry

如果返回https://registry.npmmirror.com/,说明配置的是淘宝镜像
如果返回https://registry.npmjs.org/,说明配置的是官网镜像

二、使用cnpm安装

1、安装cnpm

 npm install -g cnpm --registry=https://registry.npmmirror.com
 
 解决安装卡顿或无法安装:
 # 注册模块镜像
 npm set registry https://re

你可能感兴趣的:(shell,npm,前端,node.js)