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.

torifat commented 6 years ago

What do you mean by "but yarn config did not fix it"? What did you try?

id77 commented 6 years ago

expected: If 'yarn.lock resolved' is unreachable, can I ignore 'resolved' in yarn.lock and install it using 'yarn config registry'.

doubt: Or recommend me delete the lock file?

Sorry, forgive me, my English is not good.

torifat commented 6 years ago

Sorry, forgive me, my English is not good.

It's not a problem as long as I can understand. And, I'm also not very good either 😄

It's not a bug. This is an expected behavior. You can either delete yarn.lock file and yarn install again. Or, if you need the exact packages then you can replace http://npm.byted.org with https://registry.yarnpkg.com in yarn.lock file.

marcelhageman commented 6 years ago

Adding this comment for other Googlers: What worked for me was increasing the Yarn network timeout:

yarn add YourPackageHere --network-timeout 100000

Apparently the package I was installing was too large (or my network too slow) so it assumed it was a network problem. It might've been, but this solved it. Just took a while.

AnthonyLamot commented 6 years ago

I'm experiencing this issue now as well. None of the aforementioned solutions seem to be working. Internet still works fine though, and no one else in the co-working space where I'm at seem to be experiencing any network issues?

sandinosaso commented 6 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.
AnthonyLamot commented 6 years ago

Figured out was wrong. One of my dependencies (react-native itself) had the wrong value and it got stuck there. Took me a while to realize because it did not show in the error report but only while the yarn command was running would it pop up for a moment.

On Jan 17, 2018 10:54, "Sandino" notifications@github.com wrote:

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 https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5%5B2/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.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/yarnpkg/yarn/issues/4890#issuecomment-358179301, or mute the thread https://github.com/notifications/unsubscribe-auth/AJeQ6UFZ6q3OqEIdUXRZKUsuoMFkbJtJks5tLWDzgaJpZM4QXTQJ .

JochenFromm commented 6 years ago

Same problem here, increasing the network timeout solved it

yarn install --network-timeout 1000000

Maybe the default timeout is too small?

HarshulSharma000 commented 6 years ago

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

anujthakwani commented 6 years ago

Task :wherehows-web:yarn yarn install v1.3.2 [1/5] Validating package.json... [2/5] Resolving packages... [3/5] 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/babel-polyfill/-/babel-polyfill-6.26.0.tgz: ESOCKETTIMEDOUT". info If you think this is a bug, please open a bug report with the information provided in "/Users/athakwani/Desktop/WhereHows/wherehows-web/yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

FAILURE: Build failed with an exception.

Any help here ?

jensbodal commented 6 years ago

Don't have a solution or why there was network issues in the first place, but the default for NETWORK_TIMEOUT is 30 seconds. Note that network-timeout is in ms, I probably wouldn't set this to higher than 5 minutes otherwise your build will just sit there for ~16 minutes (1000000ms) is there truly is network connectivity issues.

https://github.com/yarnpkg/yarn/search?utf8=%E2%9C%93&q=NETWORK_TIMEOUT&type=

marcelorl commented 6 years ago

@HarshulSharma000 same issue

HarshulSharma000 commented 6 years ago

@marcelori I tried to revert to nodejs 8.9.4(lts) and then tried with --network-timeout=99999 and it works. Note:- I am using yarn 1.4.0

suhailgupta03 commented 6 years ago

Looks like yarn was trying to connect via a proxy. The following worked for me:

npm config rm proxy
npm config rm https-proxy
jesper-bylund commented 6 years ago

I'm still having this issue. Increasing network timeout did not help, nor did @suhailgupta03 's proxy removal. Right now, yarn won't install, add, or do anything. I've tried it through three different networks.

benseitz commented 6 years ago

same here......

abishekrsrikaanth commented 6 years ago

same here

MichelDiz commented 6 years ago

"is there truly is network connectivity issues." I don't think so. I have 100Mb of internet. No services are with trouble. Downloads are perfect, VOIP is perfect, NPM shines. Only Yarn I have this... Something dark is happening.

UPDATE: I did some voodoo trick and works fine now https://github.com/yarnpkg/yarn/issues/5259#issuecomment-379769451

adjavaherian commented 6 years ago

Might be by design. There's a registry in ~/.yarnrc that's autogenerated. Perhaps its behind a VPN or something?


cat ~/.yarnrc 
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

registry "https://artifactory.some.net/api/npm"
lastUpdateCheck 1233305747
MichelDiz commented 6 years ago

mine (Looks like the registry address is empty - was not it supposed to contain something?):

=> cat ~/.yarnrc
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1

lastUpdateCheck 1523327705543

But, until now the "voodoo trick" is working great for me.

jesper-bylund commented 6 years ago

@adjavaherian This works! Mine was stuck to a VPN URL at my company. NO idea why it was set to that though. Because I don't use the VPN for yarn at all.

learntoswim commented 6 years ago

The "voodoo" trick posted above by @MichelDiz worked for me as well.

Deja-vuuu commented 6 years ago

So,How to solve this problem? I ran into the same problem on Windows.

Ryuurock commented 6 years ago

+1

cp1001 commented 6 years ago

this kind of error occurs when your net cannot access some package resource which yarn.lock file specified. check your yarn.lock file or delete yarn.lock,then change npm registry to other public regitstry,then yarn install.

point are: donot use private registry. check your network's connection to registry.

FDiskas commented 6 years ago
Yarn version: 
  1.9.4

Node version: 
  9.11.2

Platform: 
  win32 x64

Trace: 
  Error: https://registry.yarnpkg.com/grid-styled/-/grid-styled-4.1.0.tgz: ESOCKETTIMEDOUT
      at ClientRequest.<anonymous> (C:\Program Files (x86)\Yarn\lib\cli.js:138095:19)

:iphone: If I try manually download - it's works

ppozeti commented 6 years ago

thought it was a problem with my private proxy npm, but I'm glad I'm not alone! Same problem is happening. If I copy the registry url and paste on chrome, it downloads the file.

spitchaiah commented 6 years ago

This worked for me:

$ yarn config delete proxy $ yarn install --network-timeout 1000000

Vadorequest commented 6 years ago

Having those troubles now but https://registry.yarnpkg.com is not responding either, may be a general outage?


Edit: After checking https://status.yarnpkg.com/ I figured my wifi connection somehow couldn't connect to that particular URL. other website work fine... Changed to mobile network and then it works.

FDiskas commented 6 years ago

Why this clone of all modules is used? Why not directly from npm? Collecting more info when and why downloading?

somewhatabstract commented 6 years ago

For me, this was because I had added two factor auth to my npmjs.org account.

I ran:

npm logout npm login

Then filled out the details, including the MFA OTP request. Then everything worked again.

zbsedefian commented 6 years ago

Vadorequest, same issue. I get back some JSON when I use my cellular network. 404 when I use my wifi network.

Vadorequest commented 6 years ago

Maybe it's related to internet providers then, maybe for some reason some URLs are blocked. I don't see any other reason why it'd fail on wifi and work on through 4G. But that's really odd if so.

jreybaylen commented 6 years ago

@Vadorequest did you solve your problem? I encountered it too.

Vadorequest commented 6 years ago

Not really, can't explain it. I just switched to a mobile network and it worked. Now I'm back on my wifi and it works too. Maybe restart your network or switching to another may fix it.

simon-robertson commented 6 years ago

I started to encounter the same issue today. Deleting the proxy resolved the issue for me.

yarn config delete proxy

zbsedefian commented 6 years ago

It works this afternoon without me having to delete proxies or adjust anything.

prasadram commented 6 years ago

i have tried all above options but nothing worked for me, still getting the same error. as below

info There appears to be trouble with your network connection. Retrying...
error An unexpected error occurred: "https://registry.yarnpkg.com/gulp-cli: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".

i got the below output when i run the command with verbose

sudo yarn --verbose global add gulp-cli
yarn global v1.10.1
verbose 0.247 Checking for configuration file "/home/prasad/.npmrc".
verbose 0.247 Found configuration file "/home/prasad/.npmrc".
verbose 0.249 Checking for configuration file "/usr/local/share/.npmrc".
verbose 0.249 Checking for configuration file "/usr/etc/npmrc".
verbose 0.249 Checking for configuration file "/home/prasad/.npmrc".
verbose 0.25 Found configuration file "/home/prasad/.npmrc".
verbose 0.25 Checking for configuration file "/home/prasad/.npmrc".
verbose 0.25 Found configuration file "/home/prasad/.npmrc".
verbose 0.251 Checking for configuration file "/home/.npmrc".
verbose 0.253 Checking for configuration file "/home/prasad/.yarnrc".
verbose 0.254 Found configuration file "/home/prasad/.yarnrc".
verbose 0.254 Checking for configuration file "/usr/local/share/.yarnrc".
verbose 0.254 Found configuration file "/usr/local/share/.yarnrc".
verbose 0.254 Checking for configuration file "/usr/etc/yarnrc".
verbose 0.255 Checking for configuration file "/home/prasad/.yarnrc".
verbose 0.255 Found configuration file "/home/prasad/.yarnrc".
verbose 0.255 Checking for configuration file "/home/prasad/.yarnrc".
verbose 0.255 Found configuration file "/home/prasad/.yarnrc".
verbose 0.256 Checking for configuration file "/home/.yarnrc".
verbose 0.26 current time: 2018-10-02T04:53:47.526Z
verbose 0.263 Checking for configuration file "/usr/local/share/.config/yarn/global/.npmrc".
verbose 0.264 Checking for configuration file "/usr/local/share/.npmrc".
verbose 0.264 Checking for configuration file "/usr/etc/npmrc".
verbose 0.264 Checking for configuration file "/home/prasad/.npmrc".
verbose 0.264 Found configuration file "/home/prasad/.npmrc".
verbose 0.265 Checking for configuration file "/usr/local/share/.config/yarn/global/.npmrc".
verbose 0.265 Checking for configuration file "/usr/local/share/.config/yarn/.npmrc".
verbose 0.265 Checking for configuration file "/usr/local/share/.config/.npmrc".
verbose 0.265 Checking for configuration file "/usr/local/share/.npmrc".
verbose 0.266 Checking for configuration file "/usr/local/.npmrc".
verbose 0.266 Checking for configuration file "/usr/.npmrc".
verbose 0.266 Checking for configuration file "/usr/local/share/.config/yarn/global/.yarnrc".
verbose 0.267 Checking for configuration file "/usr/local/share/.yarnrc".
verbose 0.267 Found configuration file "/usr/local/share/.yarnrc".
verbose 0.267 Checking for configuration file "/usr/etc/yarnrc".
verbose 0.267 Checking for configuration file "/home/prasad/.yarnrc".
verbose 0.268 Found configuration file "/home/prasad/.yarnrc".
verbose 0.268 Checking for configuration file "/usr/local/share/.config/yarn/global/.yarnrc".
verbose 0.268 Checking for configuration file "/usr/local/share/.config/yarn/.yarnrc".
verbose 0.268 Checking for configuration file "/usr/local/share/.config/.yarnrc".
verbose 0.269 Checking for configuration file "/usr/local/share/.yarnrc".
verbose 0.269 Found configuration file "/usr/local/share/.yarnrc".
verbose 0.269 Checking for configuration file "/usr/local/.yarnrc".
verbose 0.269 Checking for configuration file "/usr/.yarnrc".
[1/4] Resolving packages...
verbose 0.367 Performing "GET" request to "https://registry.yarnpkg.com/gulp-cli".
info There appears to be trouble with your network connection. Retrying...
verbose 3.487 Performing "GET" request to "https://registry.yarnpkg.com/gulp-cli".
info There appears to be trouble with your network connection. Retrying...
verbose 6.496 Performing "GET" request to "https://registry.yarnpkg.com/gulp-cli".
info There appears to be trouble with your network connection. Retrying...
verbose 9.505 Performing "GET" request to "https://registry.yarnpkg.com/gulp-cli".
info There appears to be trouble with your network connection. Retrying...
verbose 12.513 Performing "GET" request to "https://registry.yarnpkg.com/gulp-cli".
verbose 12.521 Error: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443
    at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:67:26)
error An unexpected error occurred: "https://registry.yarnpkg.com/gulp-cli: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".
info If you think this is a bug, please open a bug report with the information provided in "/usr/local/share/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.

Note: I am using Ubuntu 16.04, nodejs:v8.12.0

melkishengue commented 6 years ago

yarn install --network-timeout 1000000 did the trick for me.

prasadram commented 6 years ago

@melkishengue it didn't worked for me sudo yarn --network-timeout 100000 global add gulp-cli still the same error

melkishengue commented 6 years ago

@prasadram What about yarn global add gulp-cli --network-timeout 100000 ?

prasadram commented 6 years ago

@melkishengue thanks for reply, still it didn't worked

[Java is awesome]:~$ sudo yarn global add gulp-cli --network-timeout 100000
[sudo] password for prasad: 
yarn global v1.10.1
[1/4] Resolving 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/gulp-cli: getaddrinfo ENOTFOUND registry.yarnpkg.com registry.yarnpkg.com:443".
info If you think this is a bug, please open a bug report with the information provided in "/usr/local/share/.config/yarn/global/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/global for documentation about this command.
yzhe8769 commented 6 years ago

I have encountered the same issue on my Mac. But this seems to be related to the DNS setting in the machine. What I have done is to manually set my DNS server to 8.8.8.8 (Google DNS) and 208.67.222.222 (Open DNS) and now it is resolved. I can run 'yarn install' again.

FDiskas commented 6 years ago

I had no problems on mac and linux only on windows there was such error. It could be related to platform also.

prasadram commented 6 years ago

@yzhe8769 do you know how to change DNS settings in ubuntu ? i want to try that options as well, because i have tried almost all options

prasadram commented 6 years ago

After investigating resolved the issue. Please check below are my analysis when i hit below command i got unknow host


curl registry.yarnpkg.com
curl: (6) Couldn't resolve host 'registry.yarnpkg.com'

i am using Desktop with LAN and OS is ubuntu 16.04 but the same command is working fine in mac then realized it's not with yarn so i have added google dsn in resolv.conf in etc folder then started working fine. hope it will help someone

yzhe8769 commented 6 years ago

After investigating resolved the issue. Please check below are my analysis when i hit below i got unknow host


curl registry.yarnpkg.com
curl: (6) Couldn't resolve host 'registry.yarnpkg.com'

i am using Desktop with LAN and OS is ubuntu 16.04 but the same command is working fine in mac then realized it's not with yarn so i have added google dsn in resolv.conf in etc folder then started working fine. hope it will help someone

All good. So if anyone also encounters this issue, that is probably because the DNS setting is preventing the resolution of the yarn registry

SkxNMDI5 commented 6 years ago

Specifying another folder for cache resolved the issue in my environment :

export YARN_CACHE_FOLDER=/tmp/.cache
bezbahadori commented 5 years ago

I have tried everything you guys suggested , and still get the error


> yarn install --network-timeout 1000000
> yarn install v1.7.0
> [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...
> info There appears to be trouble with your network connection. Retrying...
> error An unexpected error occurred: "https://registry.yarnpkg.com/aws-sdk/-/aws-sdk-2.328.0.tgz: read ECONNRESET".
> info If you think this is a bug, please open a bug report with the information provided in "C:\\Git\\broadvoice.communicator\\yarn-error.log".
> info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
> info There appears to be trouble with your network connection. Retrying...
> info There appears to be trouble with your network connection. Retrying..
whereisaaron commented 5 years ago

I get these spurious network errors too.

$ yarn install
yarn install v1.10.1
[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...
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...
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/@fortawesome/free-solid-svg-icons/-/free-solid-svg-icons-5.3.1.tgz: ESOCKETTIMEDOUT".
info If you think this is a bug, please open a bug report with the information provided in "[..]/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
info There appears to be trouble with your network connection. Retrying...
info There appears to be trouble with your network connection. Retrying...

Repeating with a --network-timeout didn't help.

$ yarn install --network-timeout=10000
yarn install v1.10.1
[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...
...