Skip to content

Commit

Permalink
refactor(core): Increase minimum supported Node.js version to 18.17
Browse files Browse the repository at this point in the history
  • Loading branch information
ivov committed May 29, 2024
1 parent ac4e0fb commit 3f58fab
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/cli/bin/n8n
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 3f58fab

Please sign in to comment.