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.42k stars 2.72k forks source link

There appears to be trouble with your network connection. Retrying... #4890

Closed id77 closed 6 years ago

id77 commented 6 years ago

➜  fuc git:(master) yarn install
yarn install v1.3.2
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
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...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "http://npm.byted.org/debug/-/debug-2.6.9.tgz: getaddrinfo ENOTFOUND npm.byted.org npm.byted.org:80".
info If you think this is a bug, please open a bug report with the information provided in "/Users/Jimmy/reactjs/react-native/fuc/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
➜  fuc git:(master) ✗

I cloned a project and I looked at the value of yarn.lock, package key 'resolved', which starts with 'http://npm.byted.org'.

I think this is the author custom yarn registry, but I can not visit 'http://npm.byted.org', but yarn config did not fix it.

the-turk commented 4 years ago

You shouldn't close issues unless you solve them or inform people about what could go wrong.

rotelando commented 4 years ago

I ran yarn while building my docker image and had the same issue as mentioned. Restarting the docker daemon solved it for me.

mirague commented 4 years ago

rm -rf /Users/xxx/.config/yarn/global/yarn.lock

@xdkaka Thanks, that worked for me! Seems that yarn.lock had some old private repository urls set.

TheCoderSingh commented 4 years ago

--network-timeout 1000000 fixed it for me but took a long time to install just one package - @material-ui/icons

Liqiankun commented 4 years ago

In my case, I deleted yarn.lock file. Then it works well.

kirill-konshin commented 4 years ago
yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
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...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/npm/-/npm-6.14.8.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/Users/runner/work/timelapser/timelapser/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

Github Actions, MacOS runner.

LucasJesusone2 commented 4 years ago

yarn install --network-timeout 1000000 Did the trick for me:

⇒  yarn install --network-timeout 1000000
yarn install v1.3.2
[1/4] 🔍  Resolving packages...
warning react-native > connect@2.30.2: connect 2.x series is deprecated
warning react-native > fbjs-scripts > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning "jest-expo > babel-jest@21.2.0" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 234.36s.

IT WORKD FOR ME! THANK YOU VERY MUCH DUDE

phyolim commented 4 years ago

I guess there isn't "one size fit all" solution for this error. In my case there was a cyberark process on my i5 computer hogging all the resources. I force ended that process and the error went away. I think it has to do with antivirus. I'm sure it will come when i restart the pc. Such a waste of time working on windows.

hckhanh commented 3 years ago

I get the same problem when I try to install yarn inside docker

Step 6/10 : COPY package.json yarn.lock ./
 ---> 72e0f798190d
Step 7/10 : RUN yarn --frozen-lockfile --check-files
 ---> Running in de083b1b3bac
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
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...
info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/escape-regexp/-/escape-regexp-0.0.1.tgz: ETIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "/usr/src/app/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
The command '/bin/sh -c yarn --frozen-lockfile --check-files' returned a non-zero code: 1
Error: Process completed with exit code 1.
shawncvv commented 3 years ago

rm -rf /Users/xxx/.config/yarn/global/yarn.lock Try it, works for me

MeralTd commented 3 years ago

npx audit fix Works for me.

fast-and-curious-1910 commented 3 years ago

For me yarn add <yourPackage> --network-timeout 36000 worked in almost all cases, but while installing @material-ui/icons, I get this message and it errors out. Tried adding it manually to package.json then deleting node_modules andj yarn.lock did not work either.

merceyz commented 3 years ago

The timeout logic is less aggressive in v2 so it will probably work for you there https://yarnpkg.com/getting-started/migration

fast-and-curious-1910 commented 3 years ago

--network-timeout 1000000 fixed it for me but took a long time to install just one package - @material-ui/icons

Same.

Nguyenkhanh98 commented 3 years ago

I am facing the same issue on Windows and setting timeout does not resolve it. On the other hand npm works fine.

The same as me