diff --git a/lib/utils/error-handler.js b/lib/utils/error-handler.js index c6481abf6737d..ba9d9f8e252e5 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,