diff options
author | Daijiro Wachi <daijiro.wachi@gmail.com> | 2016-09-21 00:48:52 +0300 |
---|---|---|
committer | Kat Marchán <kzm@sykosomatic.org> | 2016-10-21 01:59:33 +0300 |
commit | 40a04d888d10a5952d5ca4080f2f5d2339d2038a (patch) | |
tree | 1fe78328838f8d718e387743bfb92dd04b3ff150 /lib/outdated.js | |
parent | bdeac3e0fb226e4777d4be5cd3c3bec8231c8044 (diff) |
outdated: exitcode != 0 on outdated dependencies
This update is a breaking change feature. When outdated dependencies
exist in a project, the command displays a helpful error message
and then finish the action with `exit 1`. To ignore the error and
keep the previous behavior, it's possible via passing `--silent` option.
Fixes: #5999
PR-URL: https://github.com/npm/npm/pull/14013
Credit: @watilde
Reviewed-By: @zkat
Reviewed-By: @iarna
Diffstat (limited to 'lib/outdated.js')
-rw-r--r-- | lib/outdated.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/outdated.js b/lib/outdated.js index dd5979836..9ad9aff6d 100644 --- a/lib/outdated.js +++ b/lib/outdated.js @@ -111,7 +111,12 @@ function outdated (args, silent, cb) { } output(table(outTable, tableOpts)) } - cb(null, list.map(function (item) { return [item[0].parent.path].concat(item.slice(1, 7)) })) + var msg = [ + 'The outdated dependencies were found. Please make sure', + 'the versions in node_module, or look over package.json', + 'to use the most suitable semver range.' + ].join('\n') + cb(msg, list.map(function (item) { return [item[0].parent.path].concat(item.slice(1, 7)) })) }) })) } |