Enforce Node.js 22+ runtime requirement, add compatibility checks for node:sqlite, and update scripts/README accordingly.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
Reference in New Issue
Block a user