安装nvm
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash
nvm install stable
npm install -g yarn
设置镜像
npm config set registry=https://registry.npm.taobao.org yarn config set registry https://registry.npm.taobao.org