一、npm 与yarn设置的镜像源不一样
查看npm的源
npm config get registry
查看yarn的源
yarn config get registry
若不一样设置为同样镜像源即可,设置方法
npm config set registry https://registry.npmmirror.com
npm config set disturl https://npm.taobao.org/dist
yarn config set registry https://registry.npmmirror.com/
yarn config set disturl https://npm.taobao.org/dist
yarn config set sass-binary-site https://npm.taobao.org/mirrors/node-sass
若以上方法不行,请尝试方法二
二、strict-ssl
yarn config set “strict-ssl” false -g