vue中yarn install报错:info There appears to be trouble with your network connection. Retrying…

问题描述

  • 使用 yarn install 的时候报以下错误
    info There appears to be trouble with your network connection. Retrying…
    info There appears to be trouble with your network connection. Retrying…
    info There appears to be trouble with your network connection. Retrying…

解决方案

  1. 网络连接有问题,检查自己的网络是否正常

  2. 若网络正常,那问题可能出现在代理连接上

  3. 控制台输入命令 yarn config get registry,查看当前镜像源是不是淘宝源。
    3.1. 如果不是淘宝镜像源,就通过命令 yarn config set registry https://registry.npm.taobao.org 将当前镜像源设置为淘宝镜像
    3.2.然后重新执行 yarn install
    在这里插入图片描述

  4. 如果以上步骤还未解决,那就重新配置
    4.1. 安装好后更换淘宝镜像 yarn config set registry https://registry.npm.taobao.org
    4.2. 移除原代理
    yarn config delete proxy
    npm config rm proxy
    npm config rm https-proxy
    4.3. 安装 cnpm 镜像并使用代理 registry
      安装 cnpm 镜像
        npm install -g cnpm --registry=https://registry.npm.taobao.org
      使用代理 registry
        npm config set registry https://registry.npm.taobao.org
    4.4. npm install

猜你喜欢

转载自blog.csdn.net/weixin_43417844/article/details/127427333