You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: don't go into global mode if aliased to npmg (#7842)
BREAKING CHANGE: npm will no longer switch to global mode if aliased to
"npmg" or "npm-g" etc.
[This
code](03bd669)
is a remnant from when npm defined `bin` entries for itself that
included `npm_g` and `npm-g`.
npm no longer defines these, and this code should have been removed when
those entries were removed. To utilize this today one would have to
manually alias npm themselves.
What this code does today in practice is make local development very
tricky, because if you (like me) use git worktrees, and have a worktree
directory that ends in "g", npm will be in global mode when you invoke
it as `node .`. This is very "magical" behavior and not at all
intuitive.
It's best if this just goes away. `npm -g` is explicit and does not
require npm trying to guess if you really wanted to be in global mode or
not.
0 commit comments