Fix better-sqlite3 installation on Windows

This commit is contained in:
larssand
2026-08-24 15:48:34 +02:00
parent de7b4adfe0
commit 79a8cb24b8
4 changed files with 442 additions and 27 deletions

View File

@@ -177,7 +177,8 @@ flowchart LR
SetupPs --> VCRuntime[winget Microsoft.VCRedist.2015+.x64]
SetupPs --> NpmCi[npm ci]
NpmCi --> Preinstall[scripts/preinstall.js]
NpmCi --> Native[better-sqlite3 prebuilt N-API binary]
NpmCi --> AllowScripts[package.json allowScripts]
AllowScripts --> Native[better-sqlite3 v12 Windows prebuilt]
NpmCi --> Postinstall[scripts/verify-install.js]
Postinstall --> SQLite[SQLite in-memory query]
Postinstall --> AMMC[AMMC/windows64 runtime check]
@@ -186,6 +187,8 @@ flowchart LR
Important constraints:
- the repository should be installed in a short ASCII path such as `C:\\Live_RC`
- `better-sqlite3` is pinned to v12.11.x because its prebuilt Windows binary works with the supported Node.js releases; npm 12 is permitted to run only this dependency installer through `package.json#allowScripts`
- `npm ci --ignore-scripts` is unsupported because it leaves the native SQLite binding uninstalled
- AMMC Windows binaries and DLLs must remain together in `AMMC\\windows64`
- `npm start` is already a background start; batch wrappers must not create a second detached npm process
- server process identity is stored in `data\\server.pid`