npm安装react速度慢的解决方案
国内的npm速度很慢,设置淘宝的镜像来源下载,速度飞快!!推荐!!!!
使用淘宝定制的cnpm (gzip 压缩支持) 命令行工具代替默认的 npm
第一种方法(临时使用):
//临时使用
npm --registry https://registry.npm.taobao.org install [模块名]
验证是否成功:
npm info [模块名]
第二种方法(持久使用):
//持久使用
npm config set registry https://registry.npm.taobao.org
验证是否成功:
npm config get registry
安装:
npm install [模块名]
第三种方法(cnpm,个人正在用):
//持久使用,推荐
npm install -g cnpm --registry=https://registry.npm.taobao.org
安装:
cnpm install [模块名]