Tell user if they try to use an old NodeJS version

This commit is contained in:
flawedworld 2022-05-08 18:54:06 +01:00 committed by Daniel Micay
parent d5df5daadf
commit 7ddc16fcc7

View file

@ -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'))