Enforce Node.js 22+ runtime requirement, add compatibility checks for node:sqlite, and update scripts/README accordingly.
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Generated
+3
@@ -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": {
|
||||||
|
|||||||
@@ -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",
|
||||||
|
|||||||
@@ -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