Skip to content

Commit 7c7c985

Browse files
committed
fix(frontend): require node 20 for electron dev
1 parent 9ae0573 commit 7c7c985

4 files changed

Lines changed: 36 additions & 0 deletions

File tree

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,10 +110,18 @@ The desktop supervisor lives under `frontend/` and is started separately:
110110

111111
```bash
112112
cd frontend
113+
nvm use 20 || nvm install 20
113114
npm install
114115
npm run dev # electron-forge start
115116
```
116117

118+
The Electron frontend is currently developed and packaged on **Node 20.x**.
119+
Newer Node 24/26 runtimes currently hit upstream Electron / Electron Forge
120+
install bugs that can leave `node_modules/electron` half-installed and make
121+
`npm run dev` fail with `Electron failed to install correctly`. The frontend
122+
package fails fast on unsupported Node versions so contributors see the fix
123+
before a partial install corrupts `node_modules`.
124+
117125
Heads-up: `npm run dev` does **not** start the daemon for you. Start it first
118126
(`ao start`, see above) — the renderer attaches to the running daemon over
119127
loopback (`127.0.0.1:3001` by default, the `AO_PORT` from the table below).

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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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 Node 24/26 releases currently hit upstream Electron/Forge install bugs",
13+
" that can leave node_modules/electron partially extracted and make",
14+
" `npm run dev` fail with `Electron failed to install correctly`.",
15+
"",
16+
"Switch to Node 20 and reinstall dependencies:",
17+
" nvm use 20 || nvm install 20",
18+
" rm -rf node_modules",
19+
" npm ci",
20+
].join("\n"),
21+
);
22+
process.exit(1);
23+
}

0 commit comments

Comments
 (0)