"npm install" installs nothing if same dep is listed in both devDependencies and dependencies (v3.3.9) #10119
Comments
At the very least this should warn, so agreed that this is a bug. However, the bug's is that the dependency in both places is pinned, and it's pinned to different versions. I haven't looked at the relevant code to confirm, but my guess is that the dependency resolution algorithm is adding both versions to the list of things to install, and then another phase of the installer is removing extraneous versions and decides that that particular version of the dependency isn't what it's expecting to see, and removes it. A fix for this is verifying that only one version of a dependency is ever queued to be installed at a given level of the tree, and that that version is known across phases. Good find! Thanks for the report! |
This probably describes the same issue, but with one extra layer of nesting:
Running npm install results in this tree:
It installs only one version of bl:
(which doesn't resolve the semver of the required Interestingly enough, if both are in
Both versions of
|
This is a pretty big bug. |
Essentially, the workaround seems to run |
I was running into the same issue in https://travis-ci.org/Ensighten/spritesmith/jobs/89172295#fold-start-before_install https://travis-ci.org/Ensighten/spritesmith/jobs/89174714#fold-start-before_install |
I've also seen this when the version is the same in both dependency lists but installing with npm version is 3.3.12 |
With NPM 3.9.3, running However, The issue that @lxe describes with transitive dependencies appears to be a separate issue (most likely #10727). |
my package json contains this:
when I npm install, nothing is installed, unless I remove the package from
dependencies
.I would expect it to install something!
Command output:
The text was updated successfully, but these errors were encountered: