Update dynamic Node.js version check

This commit is contained in:
Daniel García Aubert 2019-03-26 19:14:39 +01:00
parent 7efb8abd97
commit 53b19d576c

5
app.js
View File

@ -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);
}