fix(installer): skip node/npm/npx symlinks for user installs - #111921
Open
Lee-Si-Yoon wants to merge 1 commit into
Open
Lee-Si-Yoon wants to merge 1 commit into
Lee-Si-Yoon wants to merge 1 commit into
Conversation
install_node_line() symlinks node/npm/npx into ~/.local/bin for user installs. rc files prepend that dir for uv, pipx, etc., so the links override the user's Node (nvm, Homebrew) in every interactive shell (NousResearch#45279). Hermes finds its own Node by absolute path and skipping the links is safe. Keep the links for root FHS and Termux, where the link dir is the only PATH entry the shell searches. Same policy as HERMES_NODE_SKIP_LINKS=1 in bootstrap_hermes_managed_node(). Fixes NousResearch#45279
Lee-Si-Yoon
force-pushed
the
fix/install-skip-user-node-symlinks
branch
from
September 15, 2026 13:39
efa9f4f to
65e4640
Compare
Contributor
Related: #45282 (open) fixes the same #45279 shadowing with a different gate (skip symlinks only when system node/npm already exist) and #45384 was an earlier closed-stale attempt with the layout gate used here. Two open approaches for a maintainer to pick between. |
Contributor
Review: fix(installer): skip node/npm/npx symlinks for user installsSummary What changed
Strengths
Findings
Verdict Reviewed using Hermes-Agent |
This branch has not been deployed
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
install_node_line()symlinksnode/npm/npxinto~/.local/binfor user installs. rc files prepend that dir for uv, pipx, etc., so the links override the user's own Node in every interactive shell.which noderesolves to Hermes' bundled Node, not nvm/Homebrew/volta.Fixes #45279.
Fix
Gate the symlinks on install layout:
/usr/local/bin): keep. Stock root shell has no other PATH entry fornode.$PREFIX/bin): keep. Same reason.~/.local/bin): skip. Hermes finds its own Node by absolute path throughfind_hermes_node_executable(), not via PATH, so skipping is safe.Why prior PRs stalled
command -vas the gate. Maintainer pointed out this also suppresses the link for root FHS when the PATH Node is too old, leaving the root recovery path withoutnode.This PR keys the decision on
$ROOT_FHS_LAYOUT, the same variableget_command_link_dir()uses, so root FHS keeps its links and only the user case changes.check_node()only reachesinstall_node_line()when the system Node was too old or had a bad npm band. The managed Node is what the install needs internally; this PR just stops dropping it into the user's interactive PATH.Repro
Before (user install with nvm v24.21.0):
After:
Hermes still resolves its own Node:
~/.hermes/node/bin/node --versionreportsv26.8.1.