From fcc169057d9083d436db7f89640b41fd668eca2f Mon Sep 17 00:00:00 2001 From: kshitijk4poor <82637225+kshitijk4poor@users.noreply.github.com> Date: Sat, 20 Jun 2026 02:01:24 +0530 Subject: [PATCH] fix(windows): prefer managed npm for hermes update desktop-rebuild gate The `hermes update` desktop-rebuild gate still used a bare `shutil.which("npm")` presence check. On a Windows box where the only working npm is the Hermes-managed npm.cmd (not on PATH), the gate would skip the desktop rebuild even though _build_web_ui / cmd_gui can now find it via find_node_executable. Route the gate through the same resolver for full bug-class coverage. Surfaced during review of #49239. --- hermes_cli/main.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hermes_cli/main.py b/hermes_cli/main.py index c2b5985c232..0870d1586f3 100644 --- a/hermes_cli/main.py +++ b/hermes_cli/main.py @@ -9043,7 +9043,9 @@ def _cmd_update_impl(args, gateway_mode: bool): # Electron build by ``hermes update``. desktop_dir = PROJECT_ROOT / "apps" / "desktop" has_desktop_app = _desktop_packaged_executable(desktop_dir) is not None or _desktop_dist_exists(desktop_dir) - if (desktop_dir / "package.json").exists() and shutil.which("npm") and has_desktop_app: + from hermes_constants import find_node_executable + + if (desktop_dir / "package.json").exists() and find_node_executable("npm") and has_desktop_app: print("→ Checking if desktop app needs rebuilding...") _desktop_build_cmd = [sys.executable, "-m", "hermes_cli.main", "desktop", "--build-only"] # Stream the build output live (long Electron builds otherwise