From 7ddc16fcc771bdee7c186ba547952707c8dc64d6 Mon Sep 17 00:00:00 2001 From: flawedworld Date: Sun, 8 May 2022 18:54:06 +0100 Subject: [PATCH] Tell user if they try to use an old NodeJS version --- bin/run | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bin/run b/bin/run index 30b14e1..f03852f 100755 --- a/bin/run +++ b/bin/run @@ -1,5 +1,11 @@ #!/usr/bin/env node +const NODE_MAJOR_VERSION = process.versions.node.split('.')[0]; + +if (NODE_MAJOR_VERSION < 17) { + throw new Error('This tool requires NodeJS 17 or later'); +} + require('@oclif/command').run() .then(require('@oclif/command/flush')) .catch(require('@oclif/errors/handle'))