Skip to content

Commit

Permalink
validate-tree: improve peer-dep missing warnings
Browse files Browse the repository at this point in the history
PR-URL: npm/npm#10846
Credit: @ryanflorence
Reviewed-By: @iarna
  • Loading branch information
ryanflorence authored and iarna committed Jul 18, 2017
1 parent 1ac470d commit b019680
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/install/validate-tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function thenValidateAllPeerDeps (idealTree, next) {
validate('OF', arguments)
validateAllPeerDeps(idealTree, function (tree, pkgname, version) {
var warn = new Error(packageId(tree) + ' requires a peer of ' + pkgname + '@' +
version + ' but none was installed.')
version + ' but none is installed. You must install peer dependencies yourself.')
warn.code = 'EPEERINVALID'
idealTree.warnings.push(warn)
})
Expand Down
2 changes: 1 addition & 1 deletion test/tap/install-scoped-with-peer-dependency.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ test('it should install peerDependencies in same tree level as the parent packag
common.npm(['install', '--loglevel=warn', './package'], EXEC_OPTS, function (err, code, stdout, stderr) {
t.ifError(err, 'install local package successful')
t.equal(code, 0, 'npm install exited with code')
t.match(stderr, /npm WARN @scope[/]package@0[.]0[.]0 requires a peer of underscore@[*] but none was installed[.]\n/,
t.match(stderr, /npm WARN @scope[/]package@0[.]0[.]0 requires a peer of underscore@[*] but none is installed[.] You must install peer dependencies yourself[.]\n/,
'npm install warned about unresolved peer dep')

t.end()
Expand Down

0 comments on commit b019680

Please sign in to comment.