npm duplicates dependency unnecessarily #4832

Closed
gzip opened this Issue Mar 4, 2014 · 2 comments

Comments

Projects
None yet
2 participants
@gzip

gzip commented Mar 4, 2014

For some reason npm isn't satisfied with the top level dependency even though it meets the requirements of the child package. I've created a test package to demonstrate the issue. This is a fresh install from the root.

$ npm -v
1.2.32

$ npm ls async
foo@0.0.0
├── async@0.2.10     <-------- This should be good
└─┬ yahoo-arrow@0.3.3
  ├── async@0.2.9     <-------- Why does it duplicate?
  ├─┬ istanbul@0.1.25
  │ ├── async@0.1.22 
  │ └─┬ handlebars@1.0.12
  │   └─┬ uglify-js@2.3.6
  │     └── async@0.2.9 
  └─┬ log4js@0.5.1
    └── async@0.1.15 

$ ack dep -A 3 package.json 
  "dependencies": {
    "async": "~0.2.0",
    "yahoo-arrow": "0.3.3"
  },

$ ack '"async"' node_modules/yahoo-arrow/package.json 
    "async": "~0.2.5",
@rlidwka

This comment has been minimized.

Show comment Hide comment
@rlidwka

rlidwka Mar 8, 2014

Contributor

yahoo-arrow has npm-shrinkwrap.json file in it, so npm follows it and install exact versions.

Contributor

rlidwka commented Mar 8, 2014

yahoo-arrow has npm-shrinkwrap.json file in it, so npm follows it and install exact versions.

@gzip

This comment has been minimized.

Show comment Hide comment
@gzip

gzip Mar 8, 2014

Ah, of course. Not the first time shrinkwrap has surprised me. Thanks.

gzip commented Mar 8, 2014

Ah, of course. Not the first time shrinkwrap has surprised me. Thanks.

@gzip gzip closed this Mar 8, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment