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

Unable to install @mui/material-icons last version #12432

Closed
2 tasks done
jgoux opened this issue Aug 7, 2018 · 41 comments
Closed
2 tasks done

Unable to install @mui/material-icons last version #12432

jgoux opened this issue Aug 7, 2018 · 41 comments
Labels
package: icons Specific to @mui/icons performance waiting for 👍 Waiting for upvotes
Milestone

Comments

@jgoux
Copy link
Contributor

jgoux commented Aug 7, 2018

Hello,

since @material-ui/icons v2.0.1, I'm unable to install it using yarn (v1.9.2).

It just timeout after a while and multiple info There appears to be trouble with your network connection. Retrying... messages.

Here is the error from yarn :

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)
  • This is a v1.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

EDIT : apparently it's a known issue : yarnpkg/yarn#6221


  • May 5, 2021: 48 upvotes
  • October 30, 2021: 57 upvotes
  • January 5, 2022: 60 upvotes
  • July 25, 2022: 65 upvotes
  • July 28, 2023: 78 upvotes
@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 7, 2018

@material-ui/icons package is around ~40M. It's not that big, but it's definitely not small!

We could save 22M by removing the /es folder. @b1f6c1c4 any objection? I know we added it into #10497 but it was before we went from 1k icons to 5k icons. With issues like #12422, I'm wondering if we shouldn't remove the index.js too. Basically, forcing people to explicitly importing the icons they need. I suspect it's already what +80% of people are doing.

For comparison:

@jgoux
Copy link
Contributor Author

jgoux commented Aug 7, 2018

I found a solution here :
yarnpkg/yarn#4890 (comment)

So either:

  • install it using yarn add @mui/material-icons --network-timeout 500000
  • or create a .yarnrc file inside your project with this content:
network-timeout 500000

I think reducing the package size to the minimum would be great. People can always go with a babel solution such as https://github.com/lodash/babel-plugin-lodash to rewrite the import.

The default timeout of yarn is 30s https://github.com/yarnpkg/yarn/blob/a4708b29ac74df97bac45365cba4f1d62537ceb7/src/constants.js#L40

@jgoux jgoux closed this as completed Aug 7, 2018
@b1f6c1c4
Copy link
Contributor

b1f6c1c4 commented Aug 7, 2018

@oliviertassinari What about separate @material-ui/icons-es from @material-ui/icons? Just like lodash-es and lodash.

Reason:

  1. Nobody wants them both at the same time
  2. With webpack, changing package name isn't a matter

@oliviertassinari

This comment has been minimized.

@barbalex
Copy link

barbalex commented Aug 7, 2018

@jgoux 's solution does seem to work. But as far as I understand everyone installing the icons will stumble over the problem. Shouldn't the installation section in the readme be extended by @jgoux 's solution?

@oliviertassinari
Copy link
Member

oliviertassinari commented Aug 8, 2018

Current yarn network timeout is 30s: https://github.com/yarnpkg/yarn/blob/15a438de996aac8b9eb08719a3f27ec03f650b21/src/constants.js#L36-L37. It should takes less than 30s to install this dependency!

What about separate @material-ui/icons-es from @material-ui/icons? Just like lodash-es and lodash.

@b1f6c1c4 I believe lodash did more harm than good to the community with the double package. It's a mess with transitive dependencies. People end-up loading the two versions.

I think that we should be removing the /es folder if more people complain about the network issue. It might even be beneficial to people doing tree-shaking by doing a full path import instead. Isn't it slow right now? The index.js has 5k exports. Let's wait and see.

@oliviertassinari oliviertassinari added the waiting for 👍 Waiting for upvotes label Aug 8, 2018
@oliviertassinari
Copy link
Member

I have added the waiting for users upvotes tag. Please upvote this issue if you are experiencing this issue and want us to work on it. We will prioritize our effort based on the number of upvotes.

@oliviertassinari

This comment has been minimized.

@oliviertassinari oliviertassinari added component: SvgIcon The React component. new feature New feature or request and removed waiting for 👍 Waiting for upvotes labels Aug 25, 2018
@oliviertassinari oliviertassinari added this to the v1.x milestone Aug 25, 2018
@jedwards1211
Copy link
Contributor

@oliviertassinari

I believe lodash did more harm than good to the community with the double package. It's a mess with transitive dependencies. People end-up loading the two versions.

Is that actually worse than if all the code is in one package and only half of your deps use the /es modules? I can't think of how it's any worse

@jedwards1211
Copy link
Contributor

I'm getting the timeout on a Raspberry Pi but I'm still confused why it would be a problem since the tarball for material-ui-icons-4.2.1.tgz is only 1.2M. Is yarn mistakenly including the unzip operation inside the timeout?

@oliviertassinari

This comment has been minimized.

@psycr0w13
Copy link

Same Issue here.
Increasing the timeout does not work for me. Ill try 500 000 instead of 100 000 but I think it wont help. Also it does work when just doing a yarn install. But if I want to build my docker container, which already wroked countless times before with this container and library, it just does not work any more.... Some help would be greatly appreciated!

@folofse
Copy link

folofse commented Oct 3, 2019

Same issue,

With yarn @material-ui/icons get stuck at 1067/1068, but with npm install it works.

Really strange...

EDIT
I manage to get it to work by upgrading yarn to the latest version (not sure if that was crucial) and use --network-timeout 500000 and just wait it out.

@oliviertassinari

This comment has been minimized.

@franklixuefei
Copy link
Contributor

FYI - I just hit it as well after upgrading yarn.

An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.4.3.tgz: ESOCKETTIMEDOUT"

I'll try the .yarnrc hack.

@oliviertassinari
Copy link
Member

oliviertassinari commented Oct 17, 2019

FontAwesome is a bit larger than us (+10%): https://packagephobia.now.sh/result?p=%40fortawesome%2Ffontawesome-free.

@franklixuefei
Copy link
Contributor

@oliviertassinari Interesting... Yes 9.60 MB is small enough TBH, given this is a lib with bunch of svg data. I'm pretty sure this is due to some blip in yarn or even my network traffic (even though it repro'ed multiple times consistently). I tried the network timeout hack and it works.

@aemc
Copy link

aemc commented Nov 14, 2019

Also got this issue. npm install fixed it for me

@helt
Copy link

helt commented Feb 8, 2020

I'm getting the timeout on a Raspberry Pi but I'm still confused why it would be a problem since the tarball for material-ui-icons-4.2.1.tgz is only 1.2M. Is yarn mistakenly including the unzip operation inside the timeout?

That sounds very reasonable - I have this failure only on a low-end device. - The timeout increase helped, though.

@xrebelox
Copy link

#14232 is definitely the way to go, I was having this issue and I managed to fix it by setting the network-timeout.

@huzaifa-99
Copy link

#12432 (comment) fixed the issue for me.

@m00rthi
Copy link

m00rthi commented May 11, 2021

Not able to install material-ui in VS Code. npm install @material-ui/core gives error. VS code installed on Win 7 laptop

@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 8, 2021

The installation size has been significantly shrunk in v5.0.0-alpha.35 with #26309 and v5.0.0-alpha.36, with #26310. We should be good now:

https://packagephobia.com/result?p=%40material-ui%2Ficons%40next

Capture d’écran 2021-06-08 à 11 06 59

@eps1lon eps1lon removed the waiting for 👍 Waiting for upvotes label Jun 8, 2021
@oliviertassinari
Copy link
Member

oliviertassinari commented Jun 10, 2021

#26310 was reverted in #26656 as it breaks Next.js.

@rattrayalex

This comment has been minimized.

@oliviertassinari

This comment has been minimized.

@rattrayalex
Copy link

rattrayalex commented Aug 18, 2021

Looks like @mui/material-icons@5.0.0 is ~15MB, which is actually more than 4.11.2 at ~10MB.

@b3nab

This comment has been minimized.

@oliviertassinari oliviertassinari changed the title Unable to install @material-ui/icons last version (2.0.1) Unable to install @mui/material-icons last version Oct 30, 2021
@oliviertassinari oliviertassinari added the waiting for 👍 Waiting for upvotes label Oct 30, 2021
obaidaattaee pushed a commit to obaidaattaee/cypress-realworld-app that referenced this issue Nov 30, 2021
* Set version for avatars

* upgrade @material-ui/core and @material-ui/icons

* add .yarnrc with increase network timeout for windows to help with material ui download

per mui/material-ui#12432 (comment)
@jacobgqc
Copy link

Still having this issue 5/23/2023
Only way I could resolve was by disabling Norton security (pre-loaded on work computer...) before performing the yarn add.

@ddecrulle
Copy link
Contributor

Same for me @mui/icons-material 5.8.0.

@mahezsh
Copy link

mahezsh commented Aug 17, 2023

You can switch to the npm registry temporarily:

yarn config set registry https://registry.npmjs.org/

Sometimes corrupt cache can cause issues. Clear the Yarn cache and try again:

yarn cache clean

@ngrcode
Copy link

ngrcode commented Aug 18, 2023

same for me

@priya2022
Copy link

The Error log reads like for me too

  • Cache Memory.
  • Esocket-Timed Out
  • Info There appears to be trouble with your network connection. Retrying...

I just simply uninstalled my ### Node in the C Drive and Re-Installed the Node it to latest version.
Now I can able to download the @mui/material-icons without any issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
package: icons Specific to @mui/icons performance waiting for 👍 Waiting for upvotes
Projects
None yet
Development

No branches or pull requests