Environment
- Windows 11 (10.0.26200)
- Node v22.23.1, npm 10.9.8
- repo @ 872f363
Symptom
node scripts/dev-desktop.mjs (the one-command dev flow) dies immediately on the first step:
Error: spawnSync npm ENOENT
Cause
The script makes a few POSIX assumptions:
execFileSync("npm", ...) (scripts/dev-desktop.mjs lines 82 and 97) — on Windows npm is npm.cmd, and .cmd files cannot be spawned without shell: true (or resolving the full npm.cmd path explicitly).
run() spawns node_modules/.bin/<tool> directly (line 28) — on Windows those are .cmd shims too, so vite and electron-forge hit the same ENOENT even once (1) is fixed.
- Teardown signals the process group with
process.kill(-child.pid, "SIGTERM") under detached: true (lines 28 and 44) — negative-PID process-group signalling does not exist on Windows; tearing down the tree there needs something like taskkill /pid <pid> /T.
- Minor but related: the
apps/cli build script ends with chmod +x dist/index.js, which fails on Windows (after esbuild has already produced the bundle, so the output itself is fine).
Workaround
Start the pieces manually, which works fine:
npm run build --workspace=@diffusionstudio/cli
- run Vite in
apps/web
electron-forge start in apps/desktop
With the CLI handshake fix for Windows named pipes (submitted separately as a PR), the full dapi mount → capture → render flow then works on Windows.
Happy to follow up with a PR making dev-desktop.mjs Windows-aware if you'd take one — it's a slightly bigger change than the handshake fix, so I've kept it as a report for now.
🤖 Generated with Claude Code
Environment
Symptom
node scripts/dev-desktop.mjs(the one-command dev flow) dies immediately on the first step:Cause
The script makes a few POSIX assumptions:
execFileSync("npm", ...)(scripts/dev-desktop.mjslines 82 and 97) — on Windows npm isnpm.cmd, and.cmdfiles cannot be spawned withoutshell: true(or resolving the fullnpm.cmdpath explicitly).run()spawnsnode_modules/.bin/<tool>directly (line 28) — on Windows those are.cmdshims too, soviteandelectron-forgehit the sameENOENTeven once (1) is fixed.process.kill(-child.pid, "SIGTERM")underdetached: true(lines 28 and 44) — negative-PID process-group signalling does not exist on Windows; tearing down the tree there needs something liketaskkill /pid <pid> /T.apps/clibuild script ends withchmod +x dist/index.js, which fails on Windows (after esbuild has already produced the bundle, so the output itself is fine).Workaround
Start the pieces manually, which works fine:
npm run build --workspace=@diffusionstudio/cliapps/webelectron-forge startinapps/desktopWith the CLI handshake fix for Windows named pipes (submitted separately as a PR), the full
dapimount → capture → render flow then works on Windows.Happy to follow up with a PR making
dev-desktop.mjsWindows-aware if you'd take one — it's a slightly bigger change than the handshake fix, so I've kept it as a report for now.🤖 Generated with Claude Code