Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failing to install big sized module #6221

Closed
danielkcz opened this issue Aug 3, 2018 · 12 comments
Closed

Failing to install big sized module #6221

danielkcz opened this issue Aug 3, 2018 · 12 comments
Assignees
Labels
fixed-in-modern This issue has been fixed / implemented in Yarn 2+. triaged

Comments

@danielkcz
Copy link

danielkcz commented Aug 3, 2018

Do you want to request a feature or report a bug?
Bu

What is the current behavior?
It's really strange. Trying to install material-design-icons module fails with There appears to be trouble with your network connection. Retrying... every time. I can install anything else and I can even download the module directly from the url it's saying...

I first encountered this issue on a freshly installed Windows computer with latest 1.9.2. Trying to install the same module with 1.7.0 seems to be working just fine.

Just a thought, but that module has over 30MB gzipped. Any chance it's too big and it just timeouts before it gets downloaded? Although I am sitting on 300Mbit connectivity, so it doesn't really take more than a couple of seconds.

[1/4] Resolving packages...
verbose 0.325 Performing "GET" request to "https://registry.yarnpkg.com/material-design-icons".
verbose 0.437 Request "https://registry.yarnpkg.com/material-design-icons" finished with status code 200.
[2/4] Fetching packages...
[-] 0/1(node:7740) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
verbose 0.921 Performing "GET" request to "https://registry.yarnpkg.com/material-design-icons/-/material-design-icons-3.0.1.tgz".
info There appears to be trouble with your network connection. Retrying...

If the current behavior is a bug, please provide the steps to reproduce.

  • create empty directory
  • yarn add material-design-icons

What is the expected behavior?
To install that module successfully.

Please mention your node.js, yarn and operating system version.
Yarn 1.9.2, NodeJS 10.8.0, Windows 10 x64

@ghost ghost assigned torifat Aug 3, 2018
@ghost ghost added the triaged label Aug 3, 2018
@eugene1g
Copy link

eugene1g commented Aug 6, 2018

This seems to be happening with smaller package too. Simple use-case, in an empty directory -
yarn add rxjs && du -hd0 node_modules -> 500kb
npm install rjxs && du -hd0 node_modules -> 16M

@danielkcz
Copy link
Author

@eugene1g I don't think this is the same issue. In your case, it apparently finishes, but it's not correctly installed. In my case, I get stuck at Fetching packages and with the repeated message

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

@ArcanoxDragon
Copy link
Contributor

@FredyC I'm encountering the same problem as you when trying to install @material-ui/icons, which likely uses the same assets as the material-design-icons package the OP is trying to install. I had to revert back to npm to install packages for now. I'm on Yarn 1.9.4, just installed less than an hour ago from scoop.

@danielkcz
Copy link
Author

Well, Yarn 1.7.0 seems to be working as well, so it's probably a bug coming from some changes between those versions.

@jgoux
Copy link

jgoux commented Aug 7, 2018

I have the same problem (with @material-ui/icons too).

Here is the error from yarn-error.log :

Yarn version: 
  1.9.2

Node version: 
  10.8.0

Platform: 
  linux x64

Trace: 
  Error: https://registry.yarnpkg.com/@material-ui/icons/-/icons-2.0.1.tgz: ESOCKETTIMEDOUT
      at ClientRequest.<anonymous> (/usr/share/yarn/lib/cli.js:138043:19)
      at Object.onceWrapper (events.js:273:13)
      at ClientRequest.emit (events.js:182:13)
      at TLSSocket.emitRequestTimeout (_http_client.js:652:40)
      at Object.onceWrapper (events.js:273:13)
      at TLSSocket.emit (events.js:182:13)
      at TLSSocket.Socket._onTimeout (net.js:448:8)
      at ontimeout (timers.js:424:11)
      at tryOnTimeout (timers.js:288:5)
      at listOnTimeout (timers.js:251:5)

@danielkcz
Copy link
Author

danielkcz commented Aug 14, 2018

Turns out that 1.7.0 has this issue as well, it just hasn't manifested itself randomly. The workaround mentioned in some other places about using eg. --network-timeout=500000 actually works in this case, but it basically means whole fetching phase takes rather long time to finish. I really don't understand why would downloading 50MB take so long time. When I try to download it directly, it's a matter 2-3 seconds.

It seems that it's not really network related, but it takes quite a long time to just unpack it. There are many small files (42K files) and without SSD it can be understandable it takes quite a long time. However, in my opinion, this should be separated from actual fetching and don't use a timeout while unpacking. It does not make sense why would you interrupt the process that cannot be really faster.

@jedwards1211
Copy link

I agree with @FredyC, my first suspicion was that unzipping is mistakenly included in the download time measurement.

@danielkcz
Copy link
Author

We have managed to migrate completely toward @material-ui/icons and there is no problem with that. Probably because it's only 15K files compared to 42K :) If we need some icon from that other package, it's always easy to just copy that particular SVG to the codebase.

@jedwards1211
Copy link

jedwards1211 commented Jul 8, 2019

oh huh, we're having the problem with @material-ui/icons though 🤦‍♂ but on a Raspberry Pi, so it's slow

@zmoshansky
Copy link

zmoshansky commented Mar 5, 2020

Was having trouble with this and other packages causing network-connection-timeout issues on MacOS Mojave.

I then disabled spotlight indexing on my dev directories per #6453. It seemed to fix the issue instantly and fixed very long yarn install times.

Occasionally, an anti-virus scan can cause similar issues, but it is usually easy to spot and stop in Activity Monitor`

@merceyz
Copy link
Member

merceyz commented Jan 2, 2021

Closing as fixed in v2 where the timeout logic is less susceptible to this sort of issue

https://yarnpkg.com/getting-started/migration

@merceyz merceyz closed this as completed Jan 2, 2021
@merceyz merceyz added the fixed-in-modern This issue has been fixed / implemented in Yarn 2+. label Jan 2, 2021
@MuneebMughal-281
Copy link

open the command prompt as an administrator and write the command yarn set version stable after that restart the terminal and try to reinstall mui icons library

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixed-in-modern This issue has been fixed / implemented in Yarn 2+. triaged
Projects
None yet
Development

No branches or pull requests

9 participants