mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-24 20:24:05 -08:00
fix(core): Enforce nodejs version consistently (#11323)
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
Some checks are pending
Test Master / install-and-build (push) Waiting to run
Test Master / Unit tests (18.x) (push) Blocked by required conditions
Test Master / Unit tests (20.x) (push) Blocked by required conditions
Test Master / Unit tests (22.4) (push) Blocked by required conditions
Test Master / Lint (push) Blocked by required conditions
Test Master / Notify Slack on failure (push) Blocked by required conditions
This commit is contained in:
parent
dd3ab3be08
commit
0fa2e8ca85
|
@ -18,22 +18,21 @@ if (process.argv.length === 2) {
|
||||||
process.argv.push('start');
|
process.argv.push('start');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const ENFORCE_NODE_VERSION_RANGE = process.env.E2E_TESTS !== 'true';
|
||||||
|
if (ENFORCE_NODE_VERSION_RANGE) {
|
||||||
|
const satisfies = require('semver/functions/satisfies');
|
||||||
const nodeVersion = process.versions.node;
|
const nodeVersion = process.versions.node;
|
||||||
const { major, gte } = require('semver');
|
const {
|
||||||
|
engines: { node: supportedNodeVersions },
|
||||||
const MINIMUM_SUPPORTED_NODE_VERSION = '18.17.0';
|
} = require('../package.json');
|
||||||
const ENFORCE_MIN_NODE_VERSION = process.env.E2E_TESTS !== 'true';
|
if (!satisfies(nodeVersion, supportedNodeVersions)) {
|
||||||
|
console.error(`
|
||||||
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.
|
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!
|
Please use a Node.js version that satisfies the following version range: ${supportedNodeVersions}
|
||||||
`);
|
`);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Disable nodejs custom inspection across the app
|
// Disable nodejs custom inspection across the app
|
||||||
const { inspect } = require('util');
|
const { inspect } = require('util');
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
"workflow"
|
"workflow"
|
||||||
],
|
],
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18.10"
|
"node": ">=18.17 <= 22"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"bin",
|
"bin",
|
||||||
|
|
Loading…
Reference in a new issue