解决方案: .
更换安装依赖的镜像,使用淘宝镜像安装,代码如下:
1、安装好后更换淘宝镜像
yarn config set registry https://registry.npm.taobao.org
2、移除原代理
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy
3、安装cnpm镜像并使用代理registry
安装cnpm镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用代理registry
npm config set registry htts://registry.npm.taobao.org
4、之后 npm install 就可以了(第四步出错运行第五步在运行第四步)
5、
npm install -g mirror-config-china --registry=http://registry.npm.taobao.org
6、 最后yarn install