From 96ab5ea602af1a62c2d2bf223c8bd48b962bce5a Mon Sep 17 00:00:00 2001 From: Ingo Reitz <9l@9lo.re> Date: Mon, 12 May 2025 07:14:52 +0200 Subject: [PATCH] Drop support for EoL NodeJS versions, default to 22 Signed-off-by: Ingo Reitz <9l@9lo.re> --- .github/workflows/main.yml | 2 +- Dockerfile | 2 +- lib/server/bootevent.js | 5 ++--- package.json | 4 ++-- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index be07a106..26c19ff3 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,7 +16,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x, 20, lts/*] + node-version: [20, 22, lts/*] mongodb-version: [4.4, 5.0, 6.0] steps: diff --git a/Dockerfile b/Dockerfile index 279d1f21..883fb3d1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM node:16.16.0-alpine +FROM node:22-alpine LABEL maintainer="Nightscout Contributors" diff --git a/lib/server/bootevent.js b/lib/server/bootevent.js index 7f09e130..b3ef32c3 100644 --- a/lib/server/bootevent.js +++ b/lib/server/bootevent.js @@ -38,9 +38,8 @@ function boot (env, language) { const isLTS = process.release.lts ? true : false; - if (isLTS || (semver.satisfies(nodeVersion, '^20.0.0') || semver.satisfies(nodeVersion, '^18.0.0') || semver.satisfies(nodeVersion, '^16.0.0') || semver.satisfies(nodeVersion, '^14.0.0'))) { - //Latest Node 14 LTS and Node 16 LTS are recommended and supported. - //Require at least Node 14 without known security issues + if (isLTS && (semver.satisfies(nodeVersion, '>=20.x'))) { + //NodeJS 20 is supported until April 2026 console.debug('Node LTS version ' + nodeVersion + ' is supported'); next(); return; diff --git a/package.json b/package.json index bdb50cc0..2093bd09 100644 --- a/package.json +++ b/package.json @@ -65,8 +65,8 @@ } }, "engines": { - "node": "^16.x || ^14.x", - "npm": "^6.x" + "node": "^22.x || ^20.x", + "npm": ">=10.x" }, "dependencies": { "@babel/core": "^7.18.10",