From 3f58faba5a55706e56792c3658c58afb890abb01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 29 May 2024 09:09:25 +0200 Subject: [PATCH 1/2] refactor(core): Increase minimum supported Node.js version to 18.17 --- packages/cli/bin/n8n | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/cli/bin/n8n b/packages/cli/bin/n8n index 2e78f0bdb9fe7..fc3a4d6cf3d86 100755 --- a/packages/cli/bin/n8n +++ b/packages/cli/bin/n8n @@ -19,12 +19,17 @@ if (process.argv.length === 2) { } const nodeVersion = process.versions.node; -const nodeVersionMajor = require('semver').major(nodeVersion); +const { major, gte } = require('semver'); -if (![18, 20, 22].includes(nodeVersionMajor)) { +const MINIMUM_SUPPORTED_NODE_VERSION = '18.17.0'; + +if ( + !gte(nodeVersion, MINIMUM_SUPPORTED_NODE_VERSION) || + ![18, 20, 22].includes(major(nodeVersion)) +) { console.log(` - Your Node.js version (${nodeVersion}) is currently not supported by n8n. - Please use Node.js v18 (recommended), v20, or v22 instead! + Your Node.js version ${nodeVersion} is currently not supported by n8n. + Please use Node.js v${MINIMUM_SUPPORTED_NODE_VERSION} (recommended), v20, or v22 instead! `); process.exit(1); } From 74c5d72de61e43eadd1f0fd3b045e7a275fbc80b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Wed, 29 May 2024 10:19:35 +0200 Subject: [PATCH 2/2] Skip min version check for e2e --- packages/cli/bin/n8n | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/packages/cli/bin/n8n b/packages/cli/bin/n8n index fc3a4d6cf3d86..859a019a56813 100755 --- a/packages/cli/bin/n8n +++ b/packages/cli/bin/n8n @@ -22,9 +22,10 @@ const nodeVersion = process.versions.node; const { major, gte } = require('semver'); const MINIMUM_SUPPORTED_NODE_VERSION = '18.17.0'; +const ENFORCE_MIN_NODE_VERSION = process.env.E2E_TESTS !== 'true'; if ( - !gte(nodeVersion, MINIMUM_SUPPORTED_NODE_VERSION) || + (ENFORCE_MIN_NODE_VERSION && !gte(nodeVersion, MINIMUM_SUPPORTED_NODE_VERSION)) || ![18, 20, 22].includes(major(nodeVersion)) ) { console.log(`