Skip to content

Commit

Permalink
chore: use Node.js version from package.json (#445)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seldszar authored and Alex Van Camp committed Oct 14, 2018
1 parent f8ec695 commit 72dcb2a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ if (!process.env.NODECG_ROOT) {
}

const semver = require('semver');
const {engines} = require('./package.json');
const nodeVersion = process.versions.node;
if (!semver.satisfies(nodeVersion, '>=8.3')) {
console.error('ERROR: NodeCG requires Node.js >=8.3 and npm >=2');

if (!semver.satisfies(nodeVersion, engines.node)) {
console.error(`ERROR: NodeCG requires Node.js ${engines.node}`);
console.error(` Your Node.js version: v${nodeVersion}`);
process.exit(1);
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
"all": true
},
"engines": {
"node": ">= 4.1.2"
"node": ">=8.3.0"
},
"files": [
"AUTHORS",
Expand Down

0 comments on commit 72dcb2a

Please sign in to comment.