Skip to content
New issue

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

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

Already on GitHub? # to your account

npm update removes other npm packages #3

Closed
skyegecko opened this issue Feb 10, 2021 · 3 comments
Closed

npm update removes other npm packages #3

skyegecko opened this issue Feb 10, 2021 · 3 comments

Comments

@skyegecko
Copy link

Using npm version 7.5.3, when running npm update -g <package> any package not specified is instead removed from the global installation. On npm version 6.14.11, the command instead seems to do nothing.

I don't think this is a bug with lspupdate specifically, as from reading online it seems that using npm update -g can produce surprising results generally.

However, would it not be safer to use npm install -g instead? This will still update the package if it is out of date, and seems to behave more as I would expect.

@alexaandru
Copy link
Owner

Thank you very much for the report, wow, I was completely unaware that updating some package in particular would remove others. That is soooo weird :)

I'll dig into this and sure, will use whatever makes more sense.

Relevant issues:

@alexaandru
Copy link
Owner

Yup, I can reproduce the issue and yes, install seems to work and seems to handle updates as well :) Wonderful, so update does installs and removes, installs does updates and installs but not removes, and removes probably does installs.. or something :D It's all clear now :) Way to go npm, keep it up!

I updated the config accordingly, thank you once again for the bug report :) Cheers!

@jnpatrick99
Copy link

jnpatrick99 commented May 8, 2022

This is really crazy to see after 6-7 years npm still randomly removes packages! So many threads on stackoverflow, here - and this never gets fixed.

Is there a way to add some kind of a command line argument to prevent npm from doing it?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants