mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-30 09:27:13 +00:00
feat: check expectated node version
This commit is contained in:
parent
f15eb9efa7
commit
ff8ffb9592
6
bin/nuxt
6
bin/nuxt
@ -4,6 +4,8 @@
|
||||
process.env.DEBUG = process.env.DEBUG || 'nuxt:*'
|
||||
|
||||
const { join } = require('path')
|
||||
const { name, engines } = require('../package.json')
|
||||
const semver = require('semver')
|
||||
const { Utils } = require('..')
|
||||
|
||||
// Global error handler
|
||||
@ -11,6 +13,10 @@ process.on('unhandledRejection', _error => {
|
||||
Utils.printError(_error)
|
||||
})
|
||||
|
||||
if (!semver.satisfies(process.version, engines.node)) {
|
||||
Utils.fatalError(`The engine "node" is incompatible with ${name}. Expected version "${engines.node}".`)
|
||||
}
|
||||
|
||||
const defaultCommand = 'dev'
|
||||
const commands = new Set([defaultCommand, 'init', 'build', 'start', 'generate'])
|
||||
|
||||
|
@ -98,6 +98,7 @@
|
||||
"postcss-url": "^7.3.0",
|
||||
"pretty-error": "^2.1.1",
|
||||
"progress-bar-webpack-plugin": "^1.10.0",
|
||||
"semver": "^5.5.0",
|
||||
"serialize-javascript": "^1.4.0",
|
||||
"serve-static": "^1.13.1",
|
||||
"server-destroy": "^1.0.1",
|
||||
|
@ -6729,7 +6729,7 @@ semver-diff@^2.0.0:
|
||||
dependencies:
|
||||
semver "^5.0.3"
|
||||
|
||||
"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1:
|
||||
"semver@2 || 3 || 4 || 5", semver@^5.0.3, semver@^5.1.0, semver@^5.3.0, semver@^5.4.1, semver@^5.5.0:
|
||||
version "5.5.0"
|
||||
resolved "https://registry.yarnpkg.com/semver/-/semver-5.5.0.tgz#dc4bbc7a6ca9d916dee5d43516f0092b58f7b8ab"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user