使用yarn的一些问题


项目场景

最近我在使用yarn的时候出现下面这种提示的频率越来越高了:
例如:info There appears to be trouble with your network connection. Retrying…


原因分析

info There appears to be trouble with your network connection. Retrying…
信息:网络连接似乎出了点问题,请重试… 但我仔细检查下来,自己的网络似乎并没有什么问题,
网络一切正常,问题就很可能出现在了代理连接上。


解决方案

更换安装依赖的镜像,使用淘宝镜像安装,代码如下:

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

npm install -g cnpm --registry=https://registry.npm.taobao.org
npm config set registry https://registry.npm.taobao.org

这样问题就解决了


文章作者: TOBY
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 TOBY !
评论
  目录