Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(core): Increase minimum supported Node.js version to 18.17 #9533

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions packages/cli/bin/n8n
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,18 @@ 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';
const ENFORCE_MIN_NODE_VERSION = process.env.E2E_TESTS !== 'true';

if (
(ENFORCE_MIN_NODE_VERSION && !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);
}
Expand Down
Loading