mirror of
https://github.com/n8n-io/n8n.git
synced 2025-02-02 07:01:30 -08:00
refactor(core): Increase minimum supported Node.js version to 18.17 (#9533)
This commit is contained in:
parent
dbaac82f79
commit
4629354705
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue