When initially pulling the code to run the [vue3-ts-vite] front-end project, the following error message appears:
Or:
Analysis: The problem occurs in the proxy connection, and the following solutions can be used to solve it.
Solution one:
- 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
- Remove original proxy:
yarn config delete proxy
npm config rm proxy
npm config rm https-proxy
- 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 .yarnrc
with the following code attached:
yarn config set registry https://registry.npm.taobao.org
Solution 3:
Delete yarn.lock
the 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.lock
file , and then reinstall.https://registry.yarnpkg.com
https://registry.npmmirror.com