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/utils
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2020-11-11 04:15:54 +0300
committerisaacs <i@izs.me>2020-11-13 22:22:56 +0300
commit1dbf0f9bb26ba70f4c6d0a807701d7652c31d7d4 (patch)
tree484d2340d7a9fe3a5afdf1f3fb2b2e56ef7a2713 /lib/utils
parentfd1d7a21b247bb35d112c51ff8d8a06fd83c8b44 (diff)
send json errors to stderr, not stdout
Fixes: #2150 Credit: @isaacs Close: #2155 Reviewed-by: @ruyadorno
Diffstat (limited to 'lib/utils')
-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 dc9e2a26b..476ca9e91 100644
--- a/lib/utils/error-handler.js
+++ b/lib/utils/error-handler.js
@@ -182,7 +182,7 @@ const errorHandler = (er) => {
detail: messageText(msg.detail),
},
}
- console.log(JSON.stringify(error, null, 2))
+ console.error(JSON.stringify(error, null, 2))
}
exit(typeof er.errno === 'number' ? er.errno : typeof er.code === 'number' ? er.code : 1)