安装

npm install yarn -g
#或者
npm install -g yarn -registry=https://registry.npmmirror.com

#Yarn源加速
yarn config set registry https://registry.npmmirror.com

加速源

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