From f10ff19157862c492c305d9e1b8b6d6fffce2ba9 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Sun, 16 Apr 2017 17:42:16 -0700 Subject: [PATCH] Check for Node v6 or later (#80) --- packages/cli/package.json | 1 + packages/cli/src/index.js | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/packages/cli/package.json b/packages/cli/package.json index 6c795f6967..ae27504c3e 100644 --- a/packages/cli/package.json +++ b/packages/cli/package.json @@ -57,6 +57,7 @@ "commander": "^2.9.0", "generator-feathers": "1.0.2", "generator-feathers-plugin": "0.10.0", + "semver": "^5.3.0", "yeoman-environment": "^1.6.6" }, "devDependencies": { diff --git a/packages/cli/src/index.js b/packages/cli/src/index.js index 68a71542bc..2bb629e74e 100644 --- a/packages/cli/src/index.js +++ b/packages/cli/src/index.js @@ -1,6 +1,7 @@ import yeoman from 'yeoman-environment'; import program from 'commander'; import meta from 'generator-feathers/meta'; +import semver from 'semver'; const env = yeoman.createEnv(); @@ -23,6 +24,11 @@ module.exports = function(argv, generatorOptions = { program.version(require('../package.json').version) .usage('generate [type]'); + if(!semver.satisfies(process.version, '>= 6.0.0')) { + console.error('The Feathers CLI and generated application requires Node v6.0.0 or later.'); + return process.exit(1); + } + program.command('generate [type]') .alias('g') .description(description)