Skip to content

Commit

Permalink
Match node's resolution when validating peer dependencies (Fixes npm#…
Browse files Browse the repository at this point in the history
  • Loading branch information
bjornstar committed Feb 24, 2018
1 parent 8452a9d commit 5522d85
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/install/deps.js
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,10 @@ var validatePeerDeps = exports.validatePeerDeps = function (tree, onInvalid) {
try {
var spec = npa.resolve(pkgname, version)
} catch (e) {}
var match = spec && findRequirement(tree.parent || tree, pkgname, spec)
if (!match) onInvalid(tree, pkgname, version)
tree.requiredBy.forEach(function (requiredBy) {
var match = spec && findRequirement(requiredBy, pkgname, spec)
if (!match) onInvalid(tree, pkgname, version)
})
})
}

Expand Down

0 comments on commit 5522d85

Please sign in to comment.