Skip to content

Commit 219b30a

Browse files
committed
fix(frontend): require node 20 for electron dev
1 parent 194bb28 commit 219b30a

4 files changed

Lines changed: 32 additions & 0 deletions

File tree

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,11 @@ Works with 23+ CLI-based coding agents including Claude Code, OpenAI Codex, Curs
8080
| Git | Any | Latest |
8181
| pnpm | Any | Latest |
8282

83+
The Electron frontend is currently developed and packaged on Node 20.x. Run
84+
`nvm use 20 || nvm install 20` before installing `frontend/` dependencies; its
85+
preinstall check rejects unsupported runtimes before they can leave Electron
86+
partially installed.
87+
8388
**Optional:**
8489

8590
- `tmux` (Darwin/Linux) - For Unix runtime

frontend/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
20

frontend/package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@
66
"description": "Electron + TypeScript frontend for the agent-orchestrator rewrite",
77
"author": "Agent Orchestrator",
88
"license": "MIT",
9+
"engines": {
10+
"node": "20.x"
11+
},
912
"homepage": "https://github.com/aoagents/agent-orchestrator",
1013
"main": ".vite/build/main.js",
1114
"repository": {
1215
"type": "git",
1316
"url": "https://github.com/aoagents/agent-orchestrator"
1417
},
1518
"scripts": {
19+
"preinstall": "node ./scripts/check-node-version.mjs",
1620
"build:daemon": "node ./scripts/build-daemon.mjs",
1721
"dev": "electron-forge start",
1822
"dev:web": "VITE_NO_ELECTRON=1 vite --config vite.renderer.config.ts",
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
const supportedMajor = 20;
2+
const currentMajor = Number.parseInt(process.versions.node.split(".")[0], 10);
3+
4+
if (currentMajor !== supportedMajor) {
5+
console.error(
6+
[
7+
`Unsupported Node.js runtime: ${process.versions.node}.`,
8+
`The Electron frontend is currently supported on Node ${supportedMajor}.x only.`,
9+
"",
10+
"Why this is enforced:",
11+
"- CI and desktop packaging run on Node 20.",
12+
"- Newer runtimes can leave node_modules/electron partially installed,",
13+
" causing `npm run dev` to fail with `Electron failed to install correctly`.",
14+
"",
15+
"Switch to Node 20 and reinstall dependencies:",
16+
" nvm use 20 || nvm install 20",
17+
" rm -rf node_modules",
18+
" npm ci",
19+
].join("\n"),
20+
);
21+
process.exit(1);
22+
}

0 commit comments

Comments
 (0)