From 190075d07028cdbb0adfca2431acc3d783b2b394 Mon Sep 17 00:00:00 2001 From: meew0 Date: Sat, 5 Dec 2015 00:39:41 +0100 Subject: [PATCH] Add node version check --- entrypoint.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/entrypoint.js b/entrypoint.js index 507cf5cb7..aadea8cf4 100644 --- a/entrypoint.js +++ b/entrypoint.js @@ -17,7 +17,16 @@ var major = parseInt(v[0]), minor = parseInt(v[1]), patch = parseInt(v[2]); -// at the moment no node version has full ES6 support +if((major == 0 && minor < 12) || (major == 0 && patch < 7)) { + console.log("discord.js doesn't support node versions less than 0.12.7."); + console.log("If you /really/ want to run it on this node (" + v + + "), then remove the check from entrypoint.js."); + console.log("However, this is unsupported and WILL cause problems."); + console.log("Exiting now."); + process.exit(1); +} + +// at the moment no node version has full ES6 support use5(); function use6(){ @@ -26,4 +35,4 @@ function use6(){ function use5(){ module.exports = require("./lib/index.js"); -} \ No newline at end of file +}