From 1ee41f3c2a1448d6b3a9b237e35c844ca6aa385b Mon Sep 17 00:00:00 2001 From: Leo Lamprecht Date: Sat, 3 Dec 2016 13:11:18 +0100 Subject: [PATCH] Don't just break for older nodes --- bin/now.js | 7 +++++++ package.json | 1 + 2 files changed, 8 insertions(+) diff --git a/bin/now.js b/bin/now.js index 551a954..edbdcd2 100755 --- a/bin/now.js +++ b/bin/now.js @@ -6,9 +6,16 @@ import {resolve} from 'path' // Packages import minimist from 'minimist' import {spawn} from 'cross-spawn' +import nodeVersion from 'node-version' // Ours import checkUpdate from '../lib/check-update' +import {error} from '../lib/error' + +if (nodeVersion.major < 6) { + error('Now requires at least version 6 of Node. Please upgrade!') + process.exit(1) +} const argv = minimist(process.argv.slice(2)) diff --git a/package.json b/package.json index 9241238..616390e 100644 --- a/package.json +++ b/package.json @@ -86,6 +86,7 @@ "minimist": "1.2.0", "ms": "0.7.2", "node-fetch": "1.6.3", + "node-version": "1.0.0", "progress": "1.1.8", "resumer": "0.0.0", "semver-compare": "1.0.0",