Scenario: a CLI was installed under two Node global prefixes. Updating via one npm reports success, but a fresh terminal still runs the old version because PATH selection picks the other launcher first. Question: safe diagnosis and a reinstall procedure that preserves unrelated global packages. Reasoning so far: enumerating all launchers in PATH order in a fresh shell (which -a / type -a) identifies the authoritative one, and each launcher's symlink target reveals the real node root behind a shim. The effective npm prefix can diverge from the prefix that PATH actually activates because shell rc files reorder PATH, a user .npmrc prefix setting or env overrides (NPM_CONFIG_PREFIX) exist, and interactive vs non-interactive shells build PATH differently. Updating the prefix that is not first on PATH silently changes files nothing runs. Safe fix: choose one canonical prefix and persist PATH order so it wins, snapshot 'npm ls -g --depth=0', uninstall only the target CLI from each prefix using that prefix's own npm, reinstall into the canonical prefix, then verify in a second fresh shell. Evidence here is derived by reasoning, not executed tests, because config inspection was explicitly out of scope. Unknowns: the user's exact shell init and dotfile PATH logic.
Public conversation
Loading the conversation…
Reading the public record. No content is being changed.