Skip to content

Redundant artifacts in PATH for global binaries #10986

@slushhh

Description

@slushhh

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

10.32.1

Which area(s) of pnpm are affected? (leave empty if unsure)

Operating System (Windows, MacOS, Linux), CLI

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

  1. Install pnpm with npm: npm -g I pnpm
  2. Either run pnpm setup or set the environment variable manually: export PNPM_HOME=~/.pnpm
  3. Install any package globally with pnpm, for example, pnpm -g i serve
  4. The binary of the installed package is placed in the root of the PNPM_HOME folder.
  5. Because PNPM_HOME points to a folder that contains other necessary for pnpm folders in addition to the binaries, these folders become available for typing/executing in the terminal (although they don't work, of course). So, you can start typing "glo" or "sto" and press Tab, and the terminal will show global or store as available commands/binaries, although they aren't actually available.

Describe the Bug

This isn't so much a bug as it is a slightly incorrect way to handle the coexistence of binaries installed globally with pnpm and the directories it requires.

TLDR: Because PNPM_HOME requires specifying the root path of a folder containing other folders besides the binaries of globally installed packages, the global environment space is polluted.

Image

Expected Behavior

Globally installed binaries should be stored in a separate directory, such as bin, as is implemented in most tools, so that the structure is:

|-bin
|--serve
|-global
|-store

Which Node.js version are you using?

24.14.0

Which operating systems have you used?

  • macOS
  • Windows
  • Linux

If your OS is a Linux based, which one it is? (Include the version if relevant)

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions