-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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 won't execute the latest version of a package #5262
Comments
I just learned about
So I found out that After I discovered that, I found out that I have a subproject which had a dev dependency of Again, it's still a bug that |
Once #5291 is merged and released you should be able to also specify a |
What you said makes sense. The part that doesn't make sense is why npx allows If it's not using that version specifier at all, then I at least expect some kind of warning like "you have specified a specific package version, but npx cannot run specific versions of packages" |
npx doesn't ignore the version, it looks for anything in your local tree that matches the spec you give it, version, tag, or range. What it can't do is work backwards from the situation where two versions are in your tree competing for the linked bin, and knowing which one won. |
Thank you for explaining; I appreciate it. So that I understand better, is this right?
|
Yes that's right. |
could npx not execute the package.json bin from v10’s dir, rather than from node_modules/.bin? |
Nope because it's not a bin there, it's just a reference to what will become the bin when |
ahh k, so unless we had a bin-links-processed version of every package that wouldn’t be a reliable option. |
Is there an existing issue for this?
This issue exists in the latest npm version
Current Behavior
I tried running
npx ts-node@latest
, but npx decided to execute a version ofts-node
that is not the latest.It even asks me if I want to install version 10.9.1, but then it runs version 9.1.1 anyway 😕
Expected Behavior
I expect
npx <package>@latest
to always run the latest version of a package.Similarly, I expect
npx <package>@<version>
to always run the specified version. For example,npx ts-node@10
should runts-node
version 10Steps To Reproduce
npx ts-node@latest --version
.~/.npm
; same problem.Environment
The text was updated successfully, but these errors were encountered: