From 999362948f696f0adb838ddb0836ba1dd83d7727 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Padez?= Date: Wed, 12 Aug 2026 21:04:13 +0000 Subject: [PATCH] allow Node 22 or newer, and record why it was pinned to exactly 22 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The preinstall check demanded exactly 22 — `v < 22 || v > 22` — which refuses Node 24, the current LTS. Relaxed to `>= 22`. Recording the reason it was exact, because it was deliberate and the details are gone: some months before now there was a real node-pty build failure that pinning to 22 solved. Nobody remembers what it was. That is exactly the kind of decision that gets undone twice, so it is written down here, in CLAUDE.md, and in the project memory rather than living in one person's recollection. What the evidence says now: node-pty 1.1.0 ships prebuilt binaries for darwin-arm64, darwin-x64, win32-arm64 and win32-x64 — and nothing for Linux. So its install script always falls through to `node-gyp rebuild` and compiles against whatever Node is installed. There is no prebuilt binary, so there is no ABI to mismatch, and node-pty declares no engines field. That reasoning is sound and completely untested: nothing here has built node-pty against 24, and node_modules has never existed on this machine. If `bun install` fails building it, or officer-pty cannot load its native module, restore the exact pin — CLAUDE.md says so, with the line to put back. Co-Authored-By: Claude Opus 5 (1M context) --- CLAUDE.md | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 564fe6dc..d64314d0 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -92,7 +92,15 @@ imported by their package name (`officerdev`, `hooks`, `state`, `types`, `helper ## Tech Stack -- **Runtime**: Bun (Node 22 is enforced by a `preinstall` check) +- **Runtime**: Bun (Node 22 or newer is enforced by a `preinstall` check) + + That check demanded *exactly* 22 until 2026-08-12. The reason was a `node-pty` build + failure some months earlier, whose details were not recorded. It was relaxed to `>= 22` + after confirming node-pty ships **no Linux prebuilds** — its install script always falls + through to `node-gyp rebuild`, so it compiles against whatever Node is present and there + is no ABI to mismatch. Untested on 24 at the time of the change. If `bun install` fails + building node-pty, or `officer-pty` cannot load its native module, restore the exact pin + first. The source build also needs `build-essential` and `python3`. - **Language**: TypeScript, strict. `bunx tsgo` is clean — keep it that way. - **Frontend**: React 19, React Router 7, React Query, Tailwind 4, shadcn/ui + custom components - **Backend**: Hono diff --git a/package.json b/package.json index 26607350..cc98348a 100644 --- a/package.json +++ b/package.json @@ -8,7 +8,7 @@ "src/workspaces/*" ], "scripts": { - "preinstall": "node -e \"var v = +process.versions.node.split('.')[0]; if (v < 22 || v > 22) { console.error('Node 22 required (got ' + process.versions.node + '). Run: nvm use 22'); process.exit(1); }\"", + "preinstall": "node -e \"var v = +process.versions.node.split('.')[0]; if (v < 22) { console.error('Node 22 or newer required (got ' + process.versions.node + '). Run: nvm use 22'); process.exit(1); }\"", "gen:index": "bun run ./scripts/gen-index.ts", "predev": "bun run ./scripts/gen-index.ts", "dev": "bun --env-file=.env --watch src/server.tsx",