Skip to content

[BUG] exec/npx: npm v8.8+/9+ break with a self-reference #5777

@ljharb

Description

@ljharb

Is there an existing issue for this?

  • I have searched the existing issues

This issue exists in the latest npm version

  • I am using the latest npm

Current Behavior

In a package foo with a bin, run npx foo, and you'll see sh: foo: command not found.

Expected Behavior

In a package foo with a bin, run npx foo, and the bin is invoked.

Steps To Reproduce

  1. Clone any repo, presumably, but in this case, https://github.com/ljharb/publishers
  2. Run npx npm@8.7 exec publishers, see that it invokes the binary properly.
  3. Run npx npm@8.8 exec publishers, see that it errors.

Environment

  • npm: <= 8.7, >= 8.8
  • Node.js: 19

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 0will get attention right awayRelease 8.xwork is associated with a specific npm 8 releaseRelease 9.xwork is associated with a specific npm 9 release

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions