From 3d530ec01318d2fdbf308ce8bad481a98164f9c7 Mon Sep 17 00:00:00 2001 From: Thomas Machado Date: Mon, 14 Sep 2026 15:13:40 +0000 Subject: [PATCH] fix: pin Node 24.18.1 and rebuild the SQLite native addon Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + .nvmrc | 2 +- AGENTS.md | 5 ++++- README.md | 5 ++++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7342948..f139df7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,6 +22,7 @@ jobs: node-version-file: .nvmrc - run: npm install --global npm@11.11.1 - run: npm ci + - run: npm rebuild better-sqlite3 --build-from-source --foreground-scripts - run: npm run setup:local - run: npm run db:migrate && npm run db:seed - run: npx playwright install --with-deps chromium diff --git a/.nvmrc b/.nvmrc index 60ade1a..8dfc5cb 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -24.19.0 +24.18.1 diff --git a/AGENTS.md b/AGENTS.md index ff66e60..5277efc 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -16,13 +16,16 @@ nvm install nvm use npm install --global npm@11.11.1 npm ci +npm rebuild better-sqlite3 --build-from-source --foreground-scripts npm run setup:local npm run db:migrate npm run db:seed npx playwright install chromium ``` -The pins are Node **24.19.0** in [.nvmrc](.nvmrc) and npm **11.11.1** in [package.json](package.json). Keep the committed lockfile and package manager. If setup fails, inspect the checkout, working directory and logs before changing anything; do not change pins or skip checks to hide an environment failure. +The pins are Node **24.18.1** in [.nvmrc](.nvmrc) and npm **11.11.1** in [package.json](package.json). Keep the committed lockfile and package manager. If setup fails, inspect the checkout, working directory and logs before changing anything; do not change pins or skip checks to hide an environment failure. + +Node 24.18.1 is a temporary pin for the upstream [native-addon cleanup regression](https://github.com/nodejs/node/issues/65446). After selecting it, run both the clean install and source rebuild above: switching Node alone can retain an incompatible `better-sqlite3` binary, and `npm ci` can obtain a cached or downloaded prebuild. The rebuild bypasses prebuilds and compiles against the selected Node headers. It requires Python 3, make and a C++ compiler (on Ubuntu: `python3 make g++`). Revisit the pin when Node 24 includes the [complete upstream fix](https://github.com/nodejs/node/pull/65943). ```sh npm run check diff --git a/README.md b/README.md index eee4cfe..ae31e3d 100644 --- a/README.md +++ b/README.md @@ -6,13 +6,14 @@ The shell from [#1](https://github.com/thomaspmach/cognition-prototype/issues/1) ## Run locally -Use Node **24.19.0** (`.nvmrc`) and npm **11.11.1** (`packageManager` in `package.json`). With an existing NVM installation: +Use Node **24.18.1** (`.nvmrc`) and npm **11.11.1** (`packageManager` in `package.json`). With an existing NVM installation: ```sh nvm install nvm use npm install --global npm@11.11.1 npm ci +npm rebuild better-sqlite3 --build-from-source --foreground-scripts npm run setup:local npm run db:migrate npm run db:seed @@ -23,6 +24,8 @@ Open http://localhost:3000. `setup:local` generates a random session secret into The font is bundled locally. `npm ci` uses the committed lockfile; do not mix package managers. npm 11 is pinned because npm 10's dependency resolver crashes on this test dependency tree. +Node 24.18.1 is temporarily pinned to avoid the [native-addon cleanup regression](https://github.com/nodejs/node/issues/65446), pending the [complete upstream fix](https://github.com/nodejs/node/pull/65943). Run the source rebuild after every clean install or Node switch: it replaces cached or downloaded `better-sqlite3` prebuilds with a binary compiled against the selected Node headers. Changing the runtime alone is insufficient. The rebuild requires Python 3, make and a C++ compiler (on Ubuntu: `python3 make g++`); CI performs the same rebuild. + ### Synthetic sign-in accounts All three local-only accounts use password **`Synthetic-demo-2026!`**: