Node bumps silently orphan user-installed global npm packages (nvm per-version globals + floating default alias) #17
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Each sindri image release bumps the bundled Node.js patch version. Because nvm (Node Version Manager) stores global npm packages per node version, and the
defaultalias floats to the newest installed line, any package installed withnpm i -gunder the previous node version silently drops offPATHafter an image update floating; resolves to the newest installed v24.xWhat we observed
Three node versions accumulated in the persisted
~/.nvm, each appearing at a container boot:yarnexists under every version (re-provisioned each time), but@mixedbread/mgrepis absent from v24.18.0's globalnode_modules. Its files still sit on disk under v24.16.0: orphaned, not deleted.Concrete breakage: a tool's startup hook runs
subprocess.Popen(["mgrep", "watch"]); withmgrepno longer onPATHit throwsFileNotFoundError: [Errno 2] No such file or directory: 'mgrep'on every new session.Root cause
~/.nvm/versions/node/<version>/lib/node_modules), not in a shared store.defaultis the floating alias24, so the active node auto-jumps to the new patch zero user action, fixes it for every consumer.Consumer-side workaround (today)
npm i -g <pkg>reinstalls into the now-active node version, but must be re-run after each node bump unless added to a per-boot bootstrap script.