mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-06 21:10:38 +00:00
fix: handle fatal errors
This commit is contained in:
parent
46fcf47db1
commit
88c3cddf32
10
bin/nuxt
10
bin/nuxt
@ -11,6 +11,16 @@ process.on('unhandledRejection', _error => {
|
|||||||
logger.error(_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)) {
|
if (!semver.satisfies(process.version, engines.node)) {
|
||||||
logger.fatal(
|
logger.fatal(
|
||||||
`The engine "node" is incompatible with ${name}. Expected version "${
|
`The engine "node" is incompatible with ${name}. Expected version "${
|
||||||
|
Loading…
Reference in New Issue
Block a user