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
+1
View File
@@ -0,0 +1 @@
22
+1 -1
View File
@@ -4,7 +4,7 @@ Gemeinsame Verwaltung von Motorrädern, Wartungen, TÜV-/Inspektionsterminen und
## Lokale Entwicklung ## Lokale Entwicklung
Voraussetzungen: Node.js 24 und npm. Voraussetzungen: Node.js 22 oder neuer und npm.
```powershell ```powershell
Copy-Item .env.example .env.local Copy-Item .env.example .env.local
+3
View File
@@ -25,6 +25,9 @@
"eslint-config-next": "16.2.12", "eslint-config-next": "16.2.12",
"tailwindcss": "^4", "tailwindcss": "^4",
"typescript": "^5" "typescript": "^5"
},
"engines": {
"node": ">=22.0.0"
} }
}, },
"node_modules/@alloc/quick-lru": { "node_modules/@alloc/quick-lru": {
+6
View File
@@ -2,7 +2,13 @@
"name": "familien-motorrad-tracker", "name": "familien-motorrad-tracker",
"version": "0.1.0", "version": "0.1.0",
"private": true, "private": true,
"engines": {
"node": ">=22.0.0"
},
"scripts": { "scripts": {
"predev": "node scripts/check-node-sqlite.mjs",
"prebuild": "node scripts/check-node-sqlite.mjs",
"prestart": "node scripts/check-node-sqlite.mjs",
"dev": "next dev", "dev": "next dev",
"build": "next build", "build": "next build",
"start": "next start", "start": "next start",
+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);
}