Skip to content

docs(troubleshooting): diagnose npm global prefix hijacked by a node shim#33

Merged
CybotTM merged 1 commit into
mainfrom
fix/node-shim-npm-prefix
Jun 21, 2026
Merged

docs(troubleshooting): diagnose npm global prefix hijacked by a node shim#33
CybotTM merged 1 commit into
mainfrom
fix/node-shim-npm-prefix

Conversation

@CybotTM

@CybotTM CybotTM commented Jun 21, 2026

Copy link
Copy Markdown
Member

Adds a troubleshooting entry for a non-obvious failure: a manual node symlink ahead of nvm on PATH (e.g. ~/.local/bin/node) hijacks npm's global prefix, so successful npm i -g installs land in a bin dir that isn't on PATH and command -v can't find them.

Covers symptoms, diagnosis (node -p process.execPath vs npm prefix -g vs nvm version default), and the fix (remove/re-point the shim + align the nvm default). Sourced from a real debugging session.

Copilot AI review requested due to automatic review settings June 21, 2026 00:54
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds a troubleshooting section to troubleshooting.md for Node/nvm issues where global installs land off-PATH due to a manual node symlink hijacking npm's prefix. The review feedback suggests replacing the hardcoded path ~/.local/bin/node with a placeholder <path-to-shim> in the fix commands to make it clear that the user should substitute their actual shim path.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread skills/cli-tools/references/troubleshooting.md Outdated

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

…shim

A manual `node` symlink on PATH ahead of nvm (e.g. ~/.local/bin/node) makes every
node/npm resolve through it, locking npm's global prefix to that Node's tree so
global installs land off-PATH. Add a PATH-Issues troubleshooting entry: symptoms,
diagnosis (process.execPath vs npm prefix -g vs nvm default), and the fix.

Signed-off-by: Sebastian Mendel <info@sebastianmendel.de>
@CybotTM CybotTM force-pushed the fix/node-shim-npm-prefix branch from fc974a4 to 3bc138d Compare June 21, 2026 10:07
@CybotTM CybotTM merged commit 3682512 into main Jun 21, 2026
17 checks passed
@CybotTM CybotTM deleted the fix/node-shim-npm-prefix branch June 21, 2026 10:09
@sonarqubecloud

Copy link
Copy Markdown

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants