Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npx binary does not account for globally-installed packages #1746

Closed
billyjanitsch opened this issue Aug 29, 2020 · 2 comments
Closed
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@billyjanitsch
Copy link

billyjanitsch commented Aug 29, 2020

Current Behavior:

If a package foo that exposes a binary is installed globally, npm 7's npx foo does not work as expected. It asks whether to install foo rather than executing the already-installed binary.

This issue also occurs if the binary does not share the package name (e.g. if foo exposes binary bar, then npx bar doesn't work either).

Expected Behavior:

npx foo should invoke a globally-installed foo, as in npm@6. Or, if this change is intentional, could it be mentioned alongside the other breaking changes to npx in the npm@7 release notes?

Steps To Reproduce:

  1. Run npm install -g npm-check-updates.
  2. Run ncu. It successfully runs the npm-check-updates binary, as expected.
  3. Run npx ncu. It does not run the binary. Instead, it asks whether it can install the ncu package:
Need to install the following packages:
  ncu
Ok to proceed? (y)

Environment:

  • OS: macOS 10.15.6
  • node: 14.9.0
  • npm: 7.0.0-beta.7
@billyjanitsch billyjanitsch added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Aug 29, 2020
@ruyadorno ruyadorno added beta-bug and removed Needs Triage needs review for next steps labels Sep 3, 2020
@darcyclarke
Copy link
Contributor

Assigning to @nlf as I believe this is related to #1845

@nlf
Copy link
Contributor

nlf commented Oct 9, 2020

@billyjanitsch this should be fixed in v7.0.0-rc.4, if you're able would you try updating to that version with npm i -g npm@next-7 and see if your issue is resolved?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants