Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Don't mark peerDependencies as extraneous. Closes #5. #6

wants to merge 2 commits into


None yet
3 participants

domenic commented Nov 6, 2012

While I was waiting for my laundry to finish drying I went ahead and implemented the naive strategy mentioned in #5.


domenic commented Nov 14, 2012

How's this look, @isaacs?

@isaacs isaacs commented on the diff Nov 25, 2012

@@ -293,6 +293,14 @@ function findUnmet (obj) {
+ var peerDeps = obj.peerDependencies = obj.peerDependencies || {}
+ Object.keys(peerDeps).forEach(function (d) {
+ var dependency = obj.parent && obj.parent.dependencies &&
+ obj.parent.dependencies[d]
+ dependency.extraneous = false

isaacs Nov 25, 2012


It should probably check to make sure that the peerDep requirement will actually be met. Something like:

if (!semver.satisfies(dependency.version, peerDeps[d])) {
  // set some flag that it's invalid, but probably need a new flag, like `peerValid` so
  // since the `valid` flag already is used for regular dependency validity.

domenic Dec 3, 2012


Done in a new commit.


domenic Dec 3, 2012


Looking at npm itself, it seems that the existing invalid flag is only used in ls to print out "INVALID". Is that correct?

@domenic domenic referenced this pull request in npm/npm Nov 29, 2012


peerDependencies (plugins) #1400


domenic commented Dec 7, 2012

@isaacs ping

@isaacs Any update on this?


isaacs commented Dec 15, 2012

Sorry for the delay. Landed in 0.0.4, updated in npm master. Thanks!

@isaacs isaacs closed this Dec 15, 2012

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