From 7560c64247783062e0749578194a16105855c4c8 Mon Sep 17 00:00:00 2001 From: Gabi Dobocan Date: Thu, 27 Apr 2023 01:06:18 +0300 Subject: [PATCH] feat: enforce min node version --- src/cli/cmds/audit.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/cli/cmds/audit.js b/src/cli/cmds/audit.js index 3435a8b..3ad2eed 100644 --- a/src/cli/cmds/audit.js +++ b/src/cli/cmds/audit.js @@ -3,6 +3,8 @@ const path = require('path'); const { files: {loadConfig}, } = require('@sandworm/utils'); +const semver = require('semver'); + const {getReport} = require('../..'); const onProgress = require('../progress'); const {getIssueCounts, failIfRequested} = require('../utils'); @@ -133,6 +135,12 @@ exports.handler = async (argv) => { const appPath = argv.path || process.cwd(); try { + if (semver.lt(process.versions.node, '14.19.0')) { + throw new UsageError( + `Sandworm requires Node >=14.19.0 (currently on ${process.versions.node})`, + ); + } + let isOutdated = false; (async () => {