-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 update gets out of memory #1627
[BUG] npm update gets out of memory #1627
Comments
I'm also getting OS: Windows 10 |
@Maxim-Mazurok thank you for confirming this. What exactly do you think should be updated in the docs? |
Well, if it's npm bug - then docs are fine. |
I believe that npm should be able to update projects's entire dependency tree without consuming all of the RAM in the process. It does look like a bug in the update implementation or algorithm. If this example would be removed from the documentation then there wouldn't be a way to update ALL of the dependencies. |
I guess you can update all of them by deleting lock file?... |
@Maxim-Mazurok Deleting a lock file would be a security violation, because it contains some useful information like package hashes. If some package would be replaced in the registry (mutated) you won't notice it if you would delete the previous lock-file. |
If you really want to - you can always check if any hashes changed manually using diff. |
I have a concrete example project where this happens, hopefully simple enough (4 dependencies) to be debuggable: FWIW, I’m seeing that it takes longer for
I hope this helps, and would like to do more to help solve this. 🤓 UPDATE: It seems that mkdir npm-hang
cd npm-hang
npm init -y
npm add enzyme # this installs the 3.11.0 at this time
npm update --depth 999 # this hangs Again, FWIW, I’m attaching both |
Cannot reproduce with @gurdiga 's minimal instructions, however running
Supplemental information:
|
Interesting. Running
Inspecting this log, I notice that there's over 9000 (literally; there's 9075) lines of the form
The numbers vary (the first number is increasing and the second number decreasing). The end of the log has
|
I just noticed that that project is using lerna, which might or might not interfere with this problem. I'll leave my comments as they are, as the information within them could still prove useful. |
npm `v6` is no longer in active development; We will continue to push security releases to `v6` at our team's discretion as-per our Support Policy. If your bug is reproducible on `v7`, please re-file this issue using our new issue template. If your issue was a feature request, please consider opening a new RRFC or RFC. If your issue was a question or other idea that was not CLI-specific, consider opening a discussion on our feedback repo Closing: This is an automated message. |
Hello!
First of all, thank you for this great tool and your awesome work!
However, I'm having a bug when updating my project:
What / Why
It looks like
npm update --depth=9999
command goes into some kind of a loop until it gets out of memory and the process is terminated with the errorJavaScript heap out of memory
.I'm not using any weird commands or combination of options. Actually this command is documented by npm. The excerpt from the official documentation:
So, this command looks like the only way to update the entire dependency tree, and it's broken. This creates a situation where one of the fundamental functions of the npm (updating dependencies) is not working. I consider this a critical bug.
When
When I run
npm update --depth=9999
in my project.Where
Sadly, I can't publish the repository due to it's proprietary nature. However, here's manifest, lock-file and the verbose update log output.
The text was updated successfully, but these errors were encountered: