-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
[BUG] npm install on Mac - Out of Memory #4895
Comments
How many git deps are in your package.json? |
35 @ljharb but each git dependency may have other git dependency.. Is that causing the issue ? But it was not an issue until we were using node 12.16.1 and npm 6.13.4 |
Typically the number of git deps you want is zero, so 35 seems like a pretty high number and the likely culprit, but I'll let the npm team weigh in. |
Oh. But my company kind of uses git dependency for private lib's.. Can i add any more info for the core team.. I can help anyway i can. @ljharb |
@sathishsoundharajan unrelated to this issue, i'd suggest your company use a private registry. git is for development, not consumption. |
Sure Thanks for the suggestion @ljharb .. Will try my best to convince them. |
For everyone interested in this thread, i have tried out these possibilities before raising this issue
|
@dlockhart @ljharb In my case, we are using gitlab.. but i believe underlying issue is npm not able to handle git based dependencies. |
Is there config, which i can tweak to reduce the no of npm install process OR git-remote-https process limit ? It seems to be happening only after migrating node version 16 and npm version to 8+ latest. |
It looks like you have a git deps depending on one another in a cycle in order to perform their So, if you have If you run with Also: it should have created a (caveat: I no longer work on npm, though it's very likely that whatever bug is causing this is one I put in there at some point in the past) |
Thank you @isaacs for your response. Here is what i have tried after your comment,
I can share privately the logs through slack ( or anyone from npm core team ). I have cleared all the existing logs from |
@sathishsoundharajan this seems like a duplicate of npm/pacote#127. The temporary workaround there looked like setting I was able to repro this by just creating a circular linked dep with a We can look into how to help folks prevent this but the easiest route will always be limiting or eliminating your use of git deps (as @ljharb mentions). Notably, cli/workspaces/arborist/lib/arborist/rebuild.js Lines 179 to 182 in 8a49e3a
Which is why using it likely doesn't change anything. This is a separate issue/concern & something we'll likely change in the next major. Let me know if setting |
Thank you so much @darcyclarke for looking into this. My finding with setting
My understanding from this code https://github.com/npm/pacote/blob/main/lib/git.js#L181 the forked process will have already resolved urls so it will skip creating new spawn by checking |
Hey @darcyclarke & npm team, Do you have any workaround for this issue :). Converting very large code base to private registry is going to take lot of time. So until we plan to that migration, is there way i can bypass this fork-bombs ? Please let me know if any help i can do to contribute |
I believe I have a repro of this in a public repository, eslint/eslint-plugin-markdown, that demonstrates a behavior change from npm 8.9 to 8.10. With If you wish to try it yourself, Was this an intentional behavior change in npm 8.10? I only noticed because our CI started failing on unrelated changes, and it turns out |
@btmills Thanks for posting a public repro.. Hope this helps the team. |
I believe my issue is similar to #4028 |
@darcyclarke Any update on fixing this issue ? This still happens with Node 18 LTS & its npm version |
@sathishsoundharajan hey! I'm no longer working at npm/GitHub but maybe @nlf / @saquibkhan can give you an idea of where this is. |
@sathishsoundharajan are you noticing this issue with npm 9. can you check the npm version you using? This is currently in backlog and will check with team if we want to prioritize it. also can you run this commend to fetch all packages using prepare |
Hey @darcyclarke Thank you for pointing me to right people. Wish you all the best for future endeavours @saquibkhan Note:
|
@saquibkhan this happens in npm9 as well. my team pinned npm to 6 and we've been waiting for a fix for a couple of years now 😅 the reason i assume this doesn't get traction is because it's inconsistent to repro. some people change OS, change laptop, rename a repo, change terminal and mitigate it. i'm pretty sure in our case is due to dependencies of our direct dependencies (material ui, core js etc)... so you will only face this issue if you have a bad combo of dependencies. someone seems to have identified the root cause and opened an issue npm/pacote#127 |
Hey @fritzy @saquibkhan Are you able to identify the issue ? |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
npm install stuck very long period of time. Eventually Mac Ran out of Memory started ask me to quit applications, even after quitting the applications npm stuck for very long period of time.
Expected Behavior
npm install should work fine
Steps To Reproduce
I dunno how to reproduce this issue outside my internal service.
Error screenshots
As you can see
npm i
is the only command which i ran, othernpm install
in activity manager created bynpm
i believe.But process eventually shows this error
Environment
The text was updated successfully, but these errors were encountered: