From f0319bc89421ad072030bee17bf3d2ff8fa66f47 Mon Sep 17 00:00:00 2001 From: youngmrz Date: Sat, 17 Jan 2026 05:17:44 -0500 Subject: [PATCH] fix(windows): add Node.js and npm paths to COMMON_BIN_PATHS for packaged apps (#1158) * fix(windows): add Node.js and npm paths to COMMON_BIN_PATHS for packaged apps When Electron runs as a packaged app on Windows, it doesn't inherit the full shell PATH. This prevents claude.cmd and other npm-installed CLIs from being found because: 1. The dynamic npm prefix detection requires npm.cmd to be in PATH 2. Even if claude.cmd is found via absolute path, it needs Node.js in PATH Add common Node.js and npm installation paths to COMMON_BIN_PATHS: - C:\Program Files\nodejs (standard Node.js installer) - ~\AppData\Local\Programs\nodejs (NVM for Windows / user install) - ~\AppData\Roaming\npm (npm global scripts - where claude.cmd lives) - ~\scoop\apps\nodejs\current (Scoop package manager) These paths use the same ~ expansion pattern as macOS/Linux paths. Fixes #598 Co-Authored-By: Claude Opus 4.5 Signed-off-by: youngmrz * fix(windows): add 32-bit Node.js and Chocolatey paths Per Gemini review feedback: - Add C:\Program Files (x86)\nodejs for 32-bit Node.js on 64-bit Windows - Add C:\ProgramData\chocolatey\bin for Chocolatey package manager Co-Authored-By: Claude Opus 4.5 Signed-off-by: youngmrz --------- Signed-off-by: youngmrz Co-authored-by: Claude Opus 4.5 Co-authored-by: Andy <119136210+AndyMik90@users.noreply.github.com> --- apps/frontend/src/main/env-utils.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/frontend/src/main/env-utils.ts b/apps/frontend/src/main/env-utils.ts index 5f592c05..d30e293a 100644 --- a/apps/frontend/src/main/env-utils.ts +++ b/apps/frontend/src/main/env-utils.ts @@ -111,6 +111,13 @@ export const COMMON_BIN_PATHS: Record = { // Windows usually handles PATH better, but we can add common locations 'C:\\Program Files\\Git\\cmd', 'C:\\Program Files\\GitHub CLI', + // Node.js and npm paths - critical for packaged Electron apps that don't inherit full PATH + 'C:\\Program Files\\nodejs', // Standard Node.js installer (64-bit) + 'C:\\Program Files (x86)\\nodejs', // 32-bit Node.js on 64-bit Windows + '~\\AppData\\Local\\Programs\\nodejs', // NVM for Windows / user install + '~\\AppData\\Roaming\\npm', // npm global scripts (claude.cmd lives here) + '~\\scoop\\apps\\nodejs\\current', // Scoop package manager + 'C:\\ProgramData\\chocolatey\\bin', // Chocolatey package manager ], };