Update dynamic Node.js version check
This commit is contained in:
parent
7efb8abd97
commit
53b19d576c
5
app.js
5
app.js
@ -14,8 +14,9 @@ var logError = console.error.bind(console);
|
||||
// jshint undef:true
|
||||
|
||||
var nodejsVersion = process.versions.node;
|
||||
if (!semver.satisfies(nodejsVersion, '>=10.15.1')) {
|
||||
logError(`Node version ${nodejsVersion} is not supported, please use Node.js 6.9 or higher.`);
|
||||
const { engines } = require('./package.json');
|
||||
if (!semver.satisfies(nodejsVersion, engines.node)) {
|
||||
logError(`Node version ${nodejsVersion} is not supported, please use Node.js ${engines.node}.`);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user