[BUG] npx won't execute the latest version of a package (original) (raw)
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
I tried running npx ts-node@latest
, but npx decided to execute a version of ts-node
that is not the latest.
$ rm -rf ~/.npm
$ node --version
v18.7.0
$ npm --version
8.16.0
$ npx ts-node --version
v9.1.1
$ npx ts-node@latest --version
Need to install the following packages:
ts-node@10.9.1
Ok to proceed? (y) y
v9.1.1
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 run ts-node
version 10
Steps To Reproduce
- Update node and npm to the latest versions.
- Try running
npx ts-node@latest --version
. - It runs an older version
- Try deleting
~/.npm
; same problem. - Try globally uninstalling ts-node; same problem.
- Try locally uninstalling ts-node; same problem.
Environment
- npm: 8.16.0
- Node.js: 18.7.0
- OS Name: WSL
; node bin location = /usr/local/bin/node
; node version = v18.7.0
; npm local prefix = /home/kkovacs/oss_97542
; npm version = 8.16.0
; cwd = /home/kkovacs/oss_97542
; HOME = /home/kkovacs
; Run npm config ls -l
to show all defaults.