yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.4k stars 2.73k forks source link

[bug?] error Error: getaddrinfo EAI_AGAIN registry.npmjs.org #9061

Open douyongpeng opened 4 months ago

douyongpeng commented 4 months ago
market@DESKTOP-GH1EHJ0:/mnt/d/chainlink_project/hh-fcc/hardhat-fundme-fcc$ yarn add --dev @typechain/hardhat
yarn add v1.22.22
warning package.json: No license field
warning hardhat-fund-me-fcc: No license field
[1/4] Resolving packages...
error Error: getaddrinfo EAI_AGAIN registry.npmjs.org
    at GetAddrInfoReqWrap.onlookupall [as oncomplete] (node:dns:120:26)
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

my registry :

market@DESKTOP-GH1EHJ0:/mnt/d/chainlink_project/hh-fcc/hardhat-fundme-fcc$ yarn config get registry
warning package.json: No license field
https://registry.yarnpkg.com

when use yarn add commmand :

yarn add --dev pkgName

it will always thrown a error like that twice a time, once success and once failed ,it's so hard when add many pkgName.

so ,who can help me to fixed it. thanks for you

Although I can create a local cache, if it fails, the package will not be cached:

yarn config set yarn-offline-mirror "~/yarn-offline-mirror"
yarn config set yarn-offline-mirror-pruning true
Daniel15 commented 4 months ago

That error means the DNS lookup timed out. You'd probably see the same error with npm too. You could try change your computer's DNS server (for example, to Cloudflare's 1.1.1.1) and see if that helps.