解决报错:info There appears to be trouble with your network connection. Retrying...

When initially pulling the code to run the [vue3-ts-vite] front-end project, the following error message appears:
Insert image description here
Or:
Insert image description here
Analysis: The problem occurs in the proxy connection, and the following solutions can be used to solve it.

Solution one:

  1. Replace the image that the installation depends on and use the Taobao image to install. The code is as follows:
yarn config set registry https://registry.npm.taobao.org
  1. Remove original proxy:
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy
  1. Install the cnpm image and use the proxy registry
安装cnpm镜像
npm install -g cnpm --registry=https://registry.npm.taobao.org
使用代理registry
npm config set registry https://registry.npm.taobao.org

Solution 2:
  For some relatively large files, such as react-dom-16.12.0.tgz, the download timeout is considered a network link problem, so the network timeout time needs to be modified. The 600000 in the above file refers to 600000/1000 = 600 seconds, which is 5 minutes. File created in the project root directory .yarnrcwith the following code attached:

 yarn config set registry https://registry.npm.taobao.org

Solution 3:
  Delete yarn.lockthe files and reinstall the dependencies, but this may cause some dependency package versions to change, which may affect compatibility. So it's better to keep it, replace it globally in the yarn.lockfile , and then reinstall.https://registry.yarnpkg.comhttps://registry.npmmirror.com

Guess you like

Origin blog.csdn.net/weixin_42132439/article/details/127861199