-
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 UPDATE removes dependencies #2322
Comments
By default, npm update covers all deps including dev deps (but not transitive dev deps, which is what the dev flag is for). Can you just omit the flag? |
Thanks for the quick reply @ljharb I removed the |
Every npm installation command prunes anything from node_modules that isn’t in package.json. What are the things being removed? |
It's always the same package, which is installed as a dev dependency. I now remember that I linked the dependency using Could |
Yes; pruning would have removed the link, and if it was in package.json, would have installed whatever was specified there. |
The dev dependency was always included in the package.json, I linked it while doing a code change. I forgot about the link, but the But all the better if it doesn't happen anymore! Can I find some more information about the |
npm If your bug is preproducible on 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. |
Current Behavior:
npm update --no-save --dev
removes dependencies from thenode_modules
folder.Also, the documentation states that As with all commands that install packages, the
--dev
flag will cause devDependencies to be processed as well. but I can't find the--dev
flag in any other part of the documentation. Shouldn't it be--save-dev
instead?Expected Behavior:
npm update --no-save --dev
should update all dependencies (including dev dependencies) and NOT remove dependencies from thenode_modules
folder.Steps To Reproduce:
I have a package.json with the some dev dependency:
When I run
npm update --no-save --dev
my dev depdency sometimes gets updated, but sometimes it just completely dissapears from thenode_modules
folder.Every subsequent run results in the package being there or not being there:
Environment:
The text was updated successfully, but these errors were encountered: