22 lines
686 B
JavaScript
22 lines
686 B
JavaScript
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);
|
|
}
|