Bump minimum version to node 18

This commit is contained in:
Nick O'Leary 2024-02-19 16:38:06 +00:00
parent 2291dc6132
commit a5223709ba
No known key found for this signature in database
GPG Key ID: 4F2157149161A6C9
6 changed files with 13 additions and 13 deletions

View File

@ -12,12 +12,11 @@ permissions:
jobs:
build:
permissions:
checks: write # for coverallsapp/github-action to create new checks
contents: read # for actions/checkout to fetch code
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16, 18, 20]
node-version: [18, 20]
steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
@ -29,8 +28,3 @@ jobs:
- name: Run tests
run: |
npm run test
# - name: Publish to coveralls.io
# if: ${{ matrix.node-version == 16 }}
# uses: coverallsapp/github-action@v1.1.2
# with:
# github-token: ${{ github.token }}

View File

@ -122,6 +122,6 @@
"supertest": "6.3.3"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
}

View File

@ -154,7 +154,7 @@ function start() {
log.info(log._("runtime.version",{component:"Node.js ",version:process.version}));
if (settings.UNSUPPORTED_VERSION) {
log.error("*****************************************************************");
log.error("* "+log._("runtime.unsupported_version",{component:"Node.js",version:process.version,requires: ">=8.9.0"})+" *");
log.error("* "+log._("runtime.unsupported_version",{component:"Node.js",version:process.version,requires: ">=18"})+" *");
log.error("*****************************************************************");
events.emit("runtime-event",{id:"runtime-unsupported-version",payload:{type:"error",text:"notification.errors.unsupportedVersion"},retain:true});
}

View File

@ -33,8 +33,7 @@ if (NODE_MAJOR_VERSION >= 16) {
function checkVersion(userSettings) {
var semver = require('semver');
if (!semver.satisfies(process.version,">=14.0.0")) {
// TODO: in the future, make this a hard error.
if (!semver.satisfies(process.version,">=18.0.0")) {
// var e = new Error("Unsupported version of Node.js");
// e.code = "unsupported_version";
// throw e;

View File

@ -47,6 +47,6 @@
"bcrypt": "5.1.0"
},
"engines": {
"node": ">=14"
"node": ">=18"
}
}

View File

@ -26,6 +26,13 @@ if (process.argv[2] === 'admin') {
return;
}
var semver = require('semver');
if (!semver.satisfies(process.version, ">=18.0.0")) {
console.log("Unsupported version of Node.js:", process.version);
console.log("Node-RED requires Node.js v18 or later");
process.exit(1)
}
var http = require('http');
var https = require('https');
var util = require("util");
@ -346,7 +353,7 @@ httpsPromise.then(function(startupHttps) {
} catch(err) {
if (err.code == "unsupported_version") {
console.log("Unsupported version of Node.js:",process.version);
console.log("Node-RED requires Node.js v8.9.0 or later");
console.log("Node-RED requires Node.js v18 or later");
} else {
console.log("Failed to start server:");
if (err.stack) {