Skip to content

fix(install): keep managed node private - #49426

Closed
Bruce-anle wants to merge 3 commits into
NousResearch:mainfrom
Bruce-anle:fix/private-node-runtime-path
Closed

Bruce-anle wants to merge 3 commits into
NousResearch:mainfrom
Bruce-anle:fix/private-node-runtime-path

Conversation

@Bruce-anle

@Bruce-anle Bruce-anle commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Stop POSIX installers from linking Hermes-managed node/npm/npx into user-global command directories.
  • Add shared Python Node runtime helpers for version-floor checks, process-local PATH augmentation, private npm resolution, and legacy symlink cleanup.
  • Clean old Hermes-owned node/npm/npx links during update, TUI bootstrap, dependency ensure, and uninstall.

Details

  • Keeps the POSIX Node floor aligned with the desktop build requirement: ^20.19 || >=22.12.
  • Preserves the node-bootstrap cascade through PATH Node, Hermes-managed Node, fnm, proto, nvm, Termux pkg, Homebrew, and bundled fallback.
  • Does not shadow a modern user-managed Node only because npm is missing.
  • Keeps update-time npm installs on the user Node path when PATH npm is selected with a modern PATH Node, avoiding Hermes-managed Node shadowing in that subprocess.
  • Leaves gateway/systemd service PATH behavior out of scope for a separate PR.

Related

Test Plan

  • /home/brucean/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_node_runtime.py tests/hermes_cli/test_dep_ensure.py tests/hermes_cli/test_tui_resume_flow.py tests/hermes_cli/test_cmd_update.py tests/hermes_cli/test_uninstall_node_symlinks.py tests/test_install_sh_node_global_prefix.py -q
    • 111 passed in 37.39s
  • bash -n scripts/install.sh
  • bash -n scripts/lib/node-bootstrap.sh
  • git diff --check HEAD~3..HEAD

Notes

  • Windows install.ps1 is intentionally out of scope for this POSIX-focused change.
  • Gateway/systemd PATH generation is intentionally left for a separate follow-up.

背景:
Hermes POSIX installers linked managed node/npm/npx into user-global command directories, which shadowed user Node managers and persisted after update.

变更点:
Add a shared Python node_runtime helper, remove shell symlink creation, add process-local PATH augmentation, and clean legacy Hermes-owned node links during update, TUI bootstrap, dependency ensure, and uninstall.

测试或冒烟结果:
- /home/brucean/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_node_runtime.py tests/hermes_cli/test_dep_ensure.py tests/hermes_cli/test_tui_resume_flow.py tests/hermes_cli/test_cmd_update.py tests/hermes_cli/test_uninstall_node_symlinks.py tests/test_install_sh_node_global_prefix.py -q
- bash -n scripts/install.sh
- bash -n scripts/lib/node-bootstrap.sh
- git diff --cached --check
@alt-glitch alt-glitch added type/bug Something isn't working comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists labels Jun 20, 2026
背景:
Independent review found two remaining Node runtime gaps: node-bootstrap accepted Node versions below the desktop build floor, and update could prepend Hermes-managed Node while running a user PATH npm.

变更点:
Sync node-bootstrap.sh version checks with ^20.19 || >=22.12, and make update only prepend Hermes-managed Node when npm is private or the PATH Node is missing/too old.

测试或冒烟结果:
- /home/brucean/.hermes/hermes-agent/venv/bin/python -m pytest tests/hermes_cli/test_node_runtime.py tests/hermes_cli/test_dep_ensure.py tests/hermes_cli/test_tui_resume_flow.py tests/hermes_cli/test_cmd_update.py tests/hermes_cli/test_uninstall_node_symlinks.py tests/test_install_sh_node_global_prefix.py -q
- bash -n scripts/install.sh
- bash -n scripts/lib/node-bootstrap.sh
- git diff --check
背景:
Independent follow-up review found HERMES_NODE_MIN_VERSION was documented as configurable even though node-bootstrap now enforces the fixed desktop build floor.

变更点:
Remove the stale HERMES_NODE_MIN_VERSION input and update node-bootstrap documentation to name the ^20.19 || >=22.12 floor.

测试或冒烟结果:
- /home/brucean/.hermes/hermes-agent/venv/bin/python -m pytest tests/test_install_sh_node_global_prefix.py -q
- bash -n scripts/lib/node-bootstrap.sh
- git diff --check
@teknium1

teknium1 commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Closing — same as #47897. The managed-Node prefix hijack is already solved on main via #46085's prefix-local ~/.hermes/node/etc/npmrc (scoped to the managed Node, never the user's global npmrc), while the node/npm/npx symlinks are intentionally retained (#38889) for FHS root installs. Removing them regresses that path.

This PR's new hermes_cli/node_runtime module duplicates helpers that already live in hermes_constants.py on main — find_node_executable, iter_hermes_node_dirs, with_hermes_node_path, hermes_managed_node_tree_present, heal_hermes_managed_node — plus remove_node_symlinks() in hermes_cli/uninstall.py. Nothing left to add. Thanks for the effort and the version-floor idea.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cli CLI entry point, hermes_cli/, setup wizard P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants