diff options
author | Beni von Cheni <benjaminlchen@gmail.com> | 2018-12-11 01:52:21 +0300 |
---|---|---|
committer | Kat Marchán <kzm@zkat.tech> | 2018-12-11 01:52:21 +0300 |
commit | 90e55a143ed1de8678d65c17bc3c2b103a15ddac (patch) | |
tree | d568b8ef1b22622425cd571ea6950adc5862d07a /lib | |
parent | 02c837e01a71a26f37cbd5a09be89df8a9ce01da (diff) |
utils: check npm.config existence in error-handler.js (#108)
Fixes: https://npm.community/t/npx-envinfo-preset-jest-fails-on-windows-with-a-stack-trace/2713
PR-URL: https://github.com/npm/cli/pull/108
Credit: @BeniCheni
Reviewed-By: @zkat
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils/error-handler.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/error-handler.js b/lib/utils/error-handler.js index c6481abf6..ba9d9f8e2 100644 --- a/lib/utils/error-handler.js +++ b/lib/utils/error-handler.js @@ -202,7 +202,7 @@ function errorHandler (er) { msg.summary.concat(msg.detail).forEach(function (errline) { log.error.apply(log, errline) }) - if (npm.config.get('json')) { + if (npm.config && npm.config.get('json')) { var error = { error: { code: er.code, |