Enforce Node.js 22+ runtime requirement, add compatibility checks for node:sqlite, and update scripts/README accordingly.

This commit is contained in:
2026-07-27 18:25:16 +02:00
parent d147692ca8
commit 7487a7d588
5 changed files with 32 additions and 1 deletions
+21
View File
@@ -0,0 +1,21 @@
const [major, minor] = process.versions.node.split(".").map(Number);
const minMajor = 22;
const minMinor = 5;
const current = process.versions.node;
if (major < minMajor || (major === minMajor && minor < minMinor)) {
console.error(
`Node.js ${minMajor}.${minMinor}+ wird benötigt (aktuell ${current}). Bitte Node aktualisieren und npm install erneut ausführen.`,
);
process.exit(1);
}
try {
await import("node:sqlite");
} catch {
console.error(
`Das Modul "node:sqlite" ist in deiner Node.js-Installation (${current}) nicht verfügbar. Bitte auf eine aktuelle Node-Version wechseln (empfohlen: 24.x) und npm install erneut ausführen.`,
);
process.exit(1);
}