全局设置npm采用淘宝镜像
npm config set registry https://registry.npm.taobao.org
取消全局npm镜像
npm config set registry https://registry.npmjs.org
安装cnpm
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install yarn -g
查看下载源
yarn config get registry
更换为淘宝源
yarn config set registry https://registry.npm.taobao.org
初始化项目
yarn init -y
安装webpack
yarn add webpack
安装webpack到dev
yarn add webpack -D
更新到最新的
yarn upgrade webpack
安装项目里的依赖
yarn install