一、npm镜像
查看npm当前使用的镜像地址命令
npm config get registry
切换为淘宝镜像命令
npm config set registry https://registry.npm.taobao.org
切换回原镜像
npm config set registry https://registry.npmjs.org
配置淘宝镜像并使用cnpm安装
npm install -g cnpm --registry=https://registry.npm.taobao.org
二、npm常用命令
清空npm缓存
npm cache clean --force