Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information