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

installs wrong version of modules #12654

Closed
ColCh opened this issue May 10, 2016 · 8 comments
Closed

installs wrong version of modules #12654

ColCh opened this issue May 10, 2016 · 8 comments

Comments

@ColCh
Copy link

ColCh commented May 10, 2016

npm versions affected as well: 3.8.9, 3.9.0

After npm cache clean, rm -r node_modules and npm install, I experience following:
( I have "lodash": "^4.11.1", in my deps)

npm ls:

npm ERR! missing: lodash@^3.10.0, required by [email protected]
npm ERR! missing: lodash@^3.10.1, required by [email protected]
npm ERR! missing: lodash@^3.10.0, required by [email protected]
npm ERR! missing: lodash@^3.10.1, required by [email protected]
npm ERR! missing: lodash@^3.10.1, required by [email protected]
npm ERR! missing: lodash@^3.10.1, required by [email protected]
npm ERR! missing: lodash@^3.10.0, required by [email protected]
npm ERR! missing: lodash@^3.10.0, required by [email protected]
npm ERR! missing: lodash@^3.10.0, required by [email protected]
npm ERR! missing: lodash@^3.2.0, required by [email protected]
npm ERR! missing: lodash@^3.10.0, required by [email protected]
npm ERR! missing: lodash@^3.9.3, required by [email protected]
npm ERR! missing: lodash@^3.10.1, required by [email protected]
npm ERR! missing: lodash@^3.5.0, required by [email protected]
npm ERR! missing: lodash@^3.2.0, required by [email protected]
npm ERR! missing: lodash@^3.6.0, required by [email protected]
npm ERR! missing: lodash@^3.3.1, required by [email protected]

Running npm install second time resolves this problem:

➜  FOO git:(navigation) npm install
[email protected] /FOO
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected] 
│ ├─┬ [email protected]
│ │ └── [email protected] 
│ ├─┬ [email protected]
│ │ └── [email protected] 
│ ├─┬ [email protected]
│ │ └── [email protected] 
│ ├─┬ [email protected]
│ │ └── [email protected] 
│ └── [email protected] 
└─┬ [email protected]
  ├─┬ [email protected]
  │ ├─┬ [email protected]
  │ │ └── [email protected] 
  │ ├─┬ [email protected]
  │ │ └─┬ [email protected]
  │ │   └── [email protected] 
  │ └─┬ [email protected]
  │   └─┬ [email protected]
  │     └── [email protected] 
  ├─┬ [email protected]
  │ └─┬ [email protected]
  │   ├─┬ [email protected]
  │   │ └─┬ [email protected]
  │   │   └── [email protected] 
  │   └── [email protected] 
  ├─┬ [email protected]
  │ └─┬ [email protected]
  │   └── [email protected] 
  └─┬ [email protected]
    ├─┬ [email protected]
    │ └─┬ [email protected]
    │   └── [email protected] 
    ├── [email protected] 
    └─┬ [email protected]
      └── [email protected] 

But I can't just run npm install twice every time :( Also my CI is broken at this point

@ColCh
Copy link
Author

ColCh commented May 10, 2016

What ...

I moved my "lodash": "^4.11.1" dependency from devDependencies to dependencies and now it works fine.

However, this is wrong behaviour, isn't it?

@lxe
Copy link
Contributor

lxe commented May 10, 2016

This is probably related to #10119

@lxe
Copy link
Contributor

lxe commented May 10, 2016

This is a major problem with npm 3 and it stuck around for most of its major revisions. The workaround so far has been to either :

  1. Install twice; or
  2. Merge devDependencies into dependencies and then run npm install

@ColCh
Copy link
Author

ColCh commented May 12, 2016

@lxe It's probably a dupe for #10277, but I'm not sure. I leave issue open, until someone from npm team will take a look on this issue.

@s-a
Copy link

s-a commented May 17, 2016

I experiance this behavior with my module. Recently changed from electron 0.x to 1.x. Tips above solve the issue only for current console session. NPM -v 2.15.1
Ref: s-a/iron-node#104

@s-a
Copy link

s-a commented May 18, 2016

Sorry for the noise. I was confused by circumstances which are related to electron. Please ignore my last post.

@schmod
Copy link
Contributor

schmod commented May 23, 2016

Looks like a dupe of #10727

schmod pushed a commit to schmod/npm that referenced this issue May 23, 2016
…st a package

Fixes several issues that were causing devDependencies to clobber
transitive dependencies.

When prod & dev dependencies are installed in the same batch, both
groups of dependencies are now processed together so that overlapping
transitive dependencies are properly deduplicated.

Fixes npm#10727 npm#11062 npm#12654 npm#10277 npm#11766 npm#11043
iarna pushed a commit that referenced this issue Dec 1, 2016
@zkat zkat closed this as completed in d8471a2 Dec 2, 2016
@zkat
Copy link
Contributor

zkat commented Dec 2, 2016

This is quite probably fixed as of [email protected] thanks to #12811. Cheers!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants