fix(windows): prefer managed node for whatsapp and desktop - #49239
Closed
helix4u wants to merge 1 commit into
Closed
fix(windows): prefer managed node for whatsapp and desktop#49239helix4u wants to merge 1 commit into
helix4u wants to merge 1 commit into
Conversation
helix4u
marked this pull request as ready for review
June 19, 2026 20:00
1 task
This was referenced Jun 19, 2026
Collaborator
|
Superseded by #49254, which salvages this work with your authorship preserved (your commit is cherry-picked verbatim at the base of that PR's stack) plus two follow-up commits on top:
Thanks for the fix, @helix4u — the cross-platform reasoning and the Closing in favor of #49254. |
kshitijk4poor
added a commit
that referenced
this pull request
Jun 19, 2026
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.
gnalvesteffer
pushed a commit
to gnalvesteffer/hermes-agent
that referenced
this pull request
Jun 19, 2026
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 NousResearch#49239.
14 tasks
waefrebeorn
pushed a commit
to waefrebeorn/slermes
that referenced
this pull request
Jul 2, 2026
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 NousResearch#49239.
habarmc1223-sudo
pushed a commit
to habarmc1223-sudo/hermes-agent-fluxmem
that referenced
this pull request
Jul 8, 2026
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 NousResearch#49239.
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
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 NousResearch#49239.
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
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 NousResearch#49239.
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
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 NousResearch#49239.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fixes Windows Hermes-owned Node/npm resolution for WhatsApp setup/gateway and Desktop rebuild/update paths.
Windows installs place Hermes-managed portable Node directly under
%LOCALAPPDATA%\hermes\nodewithnode.exeandnpm.cmd. Several Hermes subprocess paths still resolved barenode/npmfrom PATH, and the Desktop updater only prependedHERMES_HOME/node/bin, which is the POSIX layout. On Windows machines with a bad or elevation-triggering system Node/npm, WhatsApp setup/gateway and Desktop rebuilds could fail even though Hermes-managed Node was installed and working.This adds one shared Python resolver for Hermes-managed Node/npm and uses it in the Python WhatsApp/Desktop/Web build paths, plus a matching Desktop main-process PATH helper for updater handoff/rebuild flows.
Related Issue
Support thread: https://discord.com/channels/1053877538025386074/1517614256680468600
Type of Change
Changes Made
hermes_constants.py: add Hermes-managed Node/npm lookup helpers for Windows%LOCALAPPDATA%\hermes\node, POSIX$HERMES_HOME/node/bin, and PATH augmentation.hermes_cli/main.py: use the managed Node/npm resolver forhermes whatsapp, web UI build, Electron redownload, Desktop build, and update-time Node dependency install.gateway/platforms/whatsapp.py: use managed Node/npm for WhatsApp requirement checks, bridge dependency install, bridge subprocess PATH, and bridge launch.apps/desktop/electron/main.cjs: prepend the Windows portable Node directory as well as the POSIXnode/bindirectory during updater handoff and in-app rebuild flows.tests/test_hermes_constants.py: add resolver coverage for Windows managed Node directory order,npm.cmdlookup, and PATH prepending.How to Test
%LOCALAPPDATA%\hermes, make sure%LOCALAPPDATA%\hermes\node\node.exeand%LOCALAPPDATA%\hermes\node\npm.cmdexist.hermes whatsappand verify bridge dependency install/pairing uses Hermes-managed Node/npm instead of the bad PATH copy.WhatsApp: Node.js not installed or bridge not configured.%LOCALAPPDATA%\hermes\node.Scoped validation run in this checkout:
python -m py_compile hermes_constants.py hermes_cli/main.py gateway/platforms/whatsapp.py tests/test_hermes_constants.pynode --check apps/desktop/electron/main.cjsnpm.cmdlookup and PATH prependingChecklist
Code
fix(scope):,feat(scope):, etc.)pytest tests/ -qand all tests passDocumentation & Housekeeping
docs/, docstrings) — or N/Acli-config.yaml.exampleif I added/changed config keys — or N/ACONTRIBUTING.mdorAGENTS.mdif I changed architecture or workflows — or N/AScreenshots / Logs
Reported support symptoms included:
hermes whatsapp: npm install failed with no output.hermes whatsapp:WinError 740, elevation required.WhatsApp: Node.js not installed or bridge not configuredandNo adapter available for whatsapp.%LOCALAPPDATA%\hermes\node\npm.cmd run packsucceeded where Desktop updater rebuild did not.