Fixed Node version check

master
Mark Moffat 2018-02-22 20:16:55 +01:00
parent ddaf235d92
commit 4d14589484
1 changed files with 3 additions and 2 deletions

5
app.js
View File

@ -296,8 +296,9 @@ app.use((err, req, res, next) => {
}); });
// Nodejs version check // Nodejs version check
if(parseInt(process.version.split('.')[0].replace('v', '')) <= 7){ const nodeVersionMajor = parseInt(process.version.split('.')[0].replace('v', ''));
console.log(colors.red('Please use Node.js version 7.x or above')); if(nodeVersionMajor < 7){
console.log(colors.red(`Please use Node.js version 7.x or above. Current version: ${nodeVersionMajor}`));
process.exit(2); process.exit(2);
} }