Do not explode by - token

This commit is contained in:
Raul Ochoa 2017-09-25 14:53:17 +00:00
parent 8daa4bb08a
commit 66380197f4

7
app.js
View File

@ -5,12 +5,11 @@ var fs = require('fs');
var _ = require('underscore'); var _ = require('underscore');
var semver = require('semver'); var semver = require('semver');
var ver = process.versions.node; var nodejsVersion = process.versions.node;
ver = ver.split('-')[0]; // explode and truncate tag from version
// jshint undef:false // jshint undef:false
if (!semver.satisfies(ver, '>6.9.0')) { if (!semver.satisfies(nodejsVersion, '>6.9.0')) {
console.log('Node version ' + ver + ' is not supported, please use Node.js 6.9 or higher.'); console.log(`Node version ${nodejsVersion} is not supported, please use Node.js 6.9 or higher.`);
process.exit(1); process.exit(1);
} }