Solution to yarn install or npm install download and installation timeout

When we install project dependencies, we often encounter installation timeouts. At this time, we usually solve the problem by changing the download source:

1. Change Taobao source:

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

2. If the timeout problem is not solved according to the above situation, it may be a network problem, and you are most likely using the default timeout. In this case, we can add the timeout period to the relevant configuration file.yarnrc:

network-timeout 600000

Or you can use the command line:

yarn add yourPackageHere --network-timeout 600000

おすすめ

転載: blog.csdn.net/Yoga99/article/details/134997594