From 96d1ddc48c8203228023ceea2e0ef8dad868c6cc Mon Sep 17 00:00:00 2001 From: Isaac Date: Mon, 16 Aug 2021 15:04:13 +0100 Subject: [PATCH] refactor: update node version check --- src/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 29b1d1e..6258af8 100644 --- a/src/index.js +++ b/src/index.js @@ -24,8 +24,9 @@ process.title = 'Discord Tickets'; -const node_version = Number(process.versions.node.split('.')[0]); -if (node_version < 14) return console.log(`\x07Error: Discord Tickets does not work on Node v${node_version}. Please upgrade to v14 or above.`); +const min_node_version = '16.6.0'; +const semver = require('semver'); +if (semver.lt(process.versions.node, min_node_version)) return console.log(`\x07Error: Discord Tickets does not work on Node v${process.versions.node}; please upgrade to v${min_node_version} or above.`); const leeks = require('leeks.js'); const fs = require('fs');