From 88c3cddf32d3703d3ef6ad67e1eb36bce62948ca Mon Sep 17 00:00:00 2001 From: Pooya Parsa Date: Mon, 2 Apr 2018 00:06:30 +0430 Subject: [PATCH] fix: handle fatal errors --- bin/nuxt | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bin/nuxt b/bin/nuxt index 539d175c5a..664d9ffb96 100755 --- a/bin/nuxt +++ b/bin/nuxt @@ -11,6 +11,16 @@ process.on('unhandledRejection', _error => { logger.error(_error) }) +// Exit process on fatal errors +consola.add({ + log(logObj) { + if (logObj.type === 'fatal') { + process.stderr.write('Nuxt Fatal Error :(\n') + process.exit(1) + } + } +}) + if (!semver.satisfies(process.version, engines.node)) { logger.fatal( `The engine "node" is incompatible with ${name}. Expected version "${