Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Dependencies shared by dependencies #10446

Closed
henit opened this issue Nov 18, 2015 · 3 comments
Closed

Dependencies shared by dependencies #10446

henit opened this issue Nov 18, 2015 · 3 comments
Labels

Comments

@henit
Copy link

henit commented Nov 18, 2015

On npm 3.3.12 (node 4.2.2), the following thing happen:

I run npm install in a project where one of the dependencies in my project is also a dependency of one of the other dependencies. For instance:

  • My project depend on PackageA and PackageB
  • PackageA also depend on PackageB
  • Both My project and PackageA depend on the same verison of PackageB

Then, I run npm update in my prroject. The NPM output lists:

PackageB@x.x.x node_modules/PackageB -> node_modules/PackageA/node_modules/PackageB

So then suddenly PackageB is not in node_modules of my project (only in node_modules under PackageA) and require("PackageB") in the files of the project fails.

What is causing this, and how can I best avoid the issue?

@henit
Copy link
Author

henit commented Nov 18, 2015

I have now upgraded to NPM 3.4.0, still the same issue.

Right now, I have to delete node_modules and run npm install every time I would normally run npm update.

@othiym23
Copy link
Contributor

Does this problem continue if you upgrade to npm@next? I believe this may have been fixed by a patch that @iarna landed in npm@3.4.1, which is currently the next release (in testing).

@othiym23 othiym23 added the bug label Nov 18, 2015
@henit
Copy link
Author

henit commented Nov 18, 2015

That fixed the issue. Thanks!

@henit henit closed this as completed Nov 18, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants