-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
doesn’t consider globally installed namespaced packages
#7257
Comments
If you’re linking it globally you don’t need npx to use it, tho. |
I know! The idea is to invoke a bin script via npx then users can choose between:
|
yeah that makes sense - i would definitely expect npx to check local first, then global, then the registry. Is this perhaps a duplicate of #5596? |
Right. That’s how it works with non-namespaced packages. |
Hey @ljharb ! I have the same problem, and it seems it started with the 20.11 Node release (and its other components). Node.js - 20.10.0 Node.js - 20.11.0 I do not have a lot of time to investigate more now, but hope it will help a bit 🙏 |
not able to reproduce the issue with the steps provided. Likely that this issue might be fixed. Please try with latest npm. ~/workarea/rep $ sudo npm link
added 1 package, and audited 3 packages in 453ms
found 0 vulnerabilities
~/workarea/rep $ hello
Hello dfsdf!
~/workarea/rep $ npx hello
Hello dfsdf!
~/workarea/rep $ npx @rauschma/hello
Hello dfsdf!
~/workarea/rep $ npm -v
10.2.4 |
Thanks! It indeed looks like the issue is fixed now. |
Is there an existing issue for this?
Related issues
This issue exists in the latest npm version
Current Behavior
Installation
I installed a package via
sudo npm link
(without publishing it to the registry):Result:
Interaction
I’m unable to use
npx @rauschma/hello
:Expected Behavior
I expected
npx @rauschma/hello
to work.Steps To Reproduce
Environment
The text was updated successfully, but these errors were encountered: