diff --git a/Dockerfile.template b/Dockerfile.template index 2380c6ad..d9a3de78 100644 --- a/Dockerfile.template +++ b/Dockerfile.template @@ -1,8 +1,8 @@ ARG ARCH=%%BALENA_ARCH%% ARG FATRW_VERSION=0.2.9 -ARG NODE="nodejs~=18" -ARG NPM="npm~=9" -ARG ALPINE_VERSION="3.18" +ARG NODE="nodejs~=20" +ARG NPM="npm~=10" +ARG ALPINE_VERSION="3.19" ################################################### # Build the supervisor dependencies diff --git a/README.md b/README.md index f89dd87a..993d7c48 100644 --- a/README.md +++ b/README.md @@ -45,7 +45,7 @@ Here's a few guidelines to make the process easier for everyone involved. These are the system requirements for developing and testing the balenaSupervisor on a local machine -- [Node.js](https://nodejs.org/en) v18 or latest +- [Node.js](https://nodejs.org/en) v20 or latest - [Rust](https://www.rust-lang.org/) v1.64 or latest for installing the [@balena/systemd](https://www.npmjs.com/package/@balena/systemd) NPM package. - If developing on an architecture not supported by default by [node-sqlite3](https://github.com/TryGhost/node-sqlite3#prebuilt-binaries), a C++ compiler and linker are also required, plus the libsqlite development headers. @@ -195,7 +195,7 @@ To run type checks, and unit tests, you can use: npm run test ``` -The supervisor runs on Node v12.16.2, so using that specific +The supervisor runs on Node v20, so using that specific version will ensure tests run in the same environment as production. diff --git a/package-lock.json b/package-lock.json index 59851038..1cd3b05e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -34,7 +34,7 @@ "@types/mocha": "^8.2.3", "@types/mock-fs": "^4.13.1", "@types/morgan": "^1.9.3", - "@types/node": "^18.11.7", + "@types/node": "^20.11.24", "@types/request": "^2.48.8", "@types/rewire": "^2.5.28", "@types/rimraf": "^2.0.5", @@ -2154,10 +2154,13 @@ } }, "node_modules/@types/node": { - "version": "18.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.7.tgz", - "integrity": "sha512-LhFTglglr63mNXUSRYD8A+ZAIu5sFqNJ4Y2fPuY7UlrySJH87rRRlhtVmMHplmfk5WkoJGmDjE9oiTfyX94CpQ==", - "dev": true + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "dependencies": { + "undici-types": "~5.26.4" + } }, "node_modules/@types/object-hash": { "version": "2.1.0", @@ -15079,6 +15082,12 @@ "debug": "^2.2.0" } }, + "node_modules/undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "node_modules/unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", @@ -17826,10 +17835,13 @@ } }, "@types/node": { - "version": "18.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-18.11.7.tgz", - "integrity": "sha512-LhFTglglr63mNXUSRYD8A+ZAIu5sFqNJ4Y2fPuY7UlrySJH87rRRlhtVmMHplmfk5WkoJGmDjE9oiTfyX94CpQ==", - "dev": true + "version": "20.11.24", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.24.tgz", + "integrity": "sha512-Kza43ewS3xoLgCEpQrsT+xRo/EJej1y0kVYGiLFE1NEODXGzTfwiC6tXTLMQskn1X4/Rjlh0MQUvx9W+L9long==", + "dev": true, + "requires": { + "undici-types": "~5.26.4" + } }, "@types/object-hash": { "version": "2.1.0", @@ -27769,6 +27781,12 @@ "debug": "^2.2.0" } }, + "undici-types": { + "version": "5.26.5", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz", + "integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==", + "dev": true + }, "unique-filename": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", diff --git a/package.json b/package.json index eed6d5b7..f782d7c9 100644 --- a/package.json +++ b/package.json @@ -35,8 +35,8 @@ "sqlite3": "^5.1.6" }, "engines": { - "node": "^18.18.0", - "npm": "^9.8.1" + "node": ">=20 <21", + "npm": ">=10" }, "devDependencies": { "@balena/contrato": "^0.6.0", @@ -60,7 +60,7 @@ "@types/mocha": "^8.2.3", "@types/mock-fs": "^4.13.1", "@types/morgan": "^1.9.3", - "@types/node": "^18.11.7", + "@types/node": "^20.11.24", "@types/request": "^2.48.8", "@types/rewire": "^2.5.28", "@types/rimraf": "^2.0.5", diff --git a/src/logging/balena-backend.ts b/src/logging/balena-backend.ts index 119df6d0..ed081d2d 100644 --- a/src/logging/balena-backend.ts +++ b/src/logging/balena-backend.ts @@ -31,7 +31,7 @@ export class BalenaLogBackend extends LogBackend { private gzip: zlib.Gzip | null = null; private opts: Options; private stream: stream.PassThrough; - private timeout: NodeJS.Timer; + private timeout: NodeJS.Timeout; public initialised = false;