-
Notifications
You must be signed in to change notification settings - Fork 3k
Config to not de-dupe during install #4037
Comments
All these issues can be easily solved by running The sad thing about this is that npm doesn't really dedupe by default. :( |
Would you mind clarifying, @rlidwka? ( If you're referring to clearing all installed deps and re-installing, that doesn't do the trick either unfortunately. See https://gist.github.com/aseemk/7140458 for an example. |
After you do
So yes, If you do |
Hmm... that's funny, but my example above doesn't really work because of #1341 . But still, it has nothing to do with deduplication. |
I'm sorry, I'm not quite following.
That's intentionally going into a module and messing with its dependencies. My point here is exactly the opposite: you would expect nested dependencies to be implementation details, encapsulated away. Simply put: if you install dependency A, then dependency B, should uninstalling A break B? Or vice versa? |
Nyaah, I surrender here. I can imagine a few ways npm can do full deduplication and still handle all this correctly, but these are too hard to be implemented in current npm state. So yep, current incomplete default deduplication is kinda weird. |
I frequently run into cases where npm's default de-duping behavior during installs leads to issues and sometimes breaks.
I described a major one related to shrinkwrapping in issue #4036, but I figured I should make a separate issue for this general request, because the effects aren't isolated to shrinkwrapping.
Example: install A, then B, where B --> A:
A won't get installed currently under B, so if you then decide you no longer need A and uninstall it, you're in a broken state:
Ultimately, the reason I ask this is because this default de-duping behavior makes npm installs unpredictable, and thus processes and workflows as a whole hard to reason about.
De-duping is also lossy — you can easily de-dupe by running
npm dedupe
, but you can't un-dedupe.Because of this, it seems like it'd be most robust for npm to not de-dupe by default — you can always
npm dedupe
afterward if you want. But I understand people might not agree with that.So at the very least, can we get a config to not de-dupe during installs? Thanks for the consideration!
The text was updated successfully, but these errors were encountered: