-
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 --no-save removes other dependencies #1460
Comments
I'm not sure this is a bug. Dependency resolution relies heavily on package.json as the source of truth. According to the docs, npm will merge the dep tree from node_modules (during an install) with what is described by package.json, and add, move, or remove deps as necessary. It's not documented specifically, but I assume that what's happening is the package.json's dep tree takes precedence over what is described by node_modules (which is by design). What usecase do you have for installing with |
I think the auto-pruning behavior is very bad UX, but it's not a bug when that feature is enabled. |
I have some dependencies that take a lot of time to be installed and not all of the devs on the project need them. So I just want to install them when the script that requires them is being called, but without having to persist them into the package.json. |
npm If your bug is reproducible 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. |
no issue - it looks like `npm install --no-save` removes dependencies - might ref npm/cli#1460 - install multiple es versions in package.json
no issue - prevention against npm/cli#1460
no issue - it looks like `npm install --no-save` removes dependencies - might ref npm/cli#1460 - install multiple es versions in package.json
no issue - prevention against npm/cli#1460
What / Why
Installing npm dependencies with the
--no-save
flag will remove other dependencies that were installed in the same manner.When
Always.
Where
How
Current Behavior
Installing npm dependencies with the
--no-save
flag will remove other dependencies that were installed in the same manner.Steps to Reproduce
npm install {package1} --no-save
. (replace package1 with whatever you want)node_modules
for {package1}, you'll find it.npm install {package2} --no-save
. (replace package2 with whatever you want)node_modules
for {package2}, you'll find it.node_modules
for {package1}, you WON'T find it.Expected Behavior
Both packages should exist in
node_modules
The text was updated successfully, but these errors were encountered: