Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorBeni von Cheni <benjaminlchen@gmail.com>2018-12-11 01:52:21 +0300
committerKat Marchán <kzm@zkat.tech>2018-12-11 01:52:21 +0300
commit90e55a143ed1de8678d65c17bc3c2b103a15ddac (patch)
treed568b8ef1b22622425cd571ea6950adc5862d07a /lib
parent02c837e01a71a26f37cbd5a09be89df8a9ce01da (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.js2
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,