Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npx does not look for latest version of package

I was making a simple npm package, I deleted the first version i.e, v0.1.0. So there is no v0.1.0 for my package. But I published later versions, with latest being v0.3.0. But when I execute npx <package-name>, it does not install latest version(v0.3.0). Instead it throws the following error.

screenshot of error message

But when I specify the version of the package (npx <project-name>@v0.3.0),it works.
So how can I make npx install latest version with being mentioned explicitly?

https://www.npmjs.com/package/create-react-flask

like image 622
Nikhil Avatar asked Dec 02 '25 09:12

Nikhil


2 Answers

This is how npx is designed to work. Basically it's always best to run npx with @latest appended to the package. So npx create-react-flask@latest in your case

See https://github.com/npm/cli/issues/4108

There's a (somewhat involved) workaround here: https://github.com/npm/cli/issues/2329#issuecomment-873487338

like image 120
Tobbe Avatar answered Dec 05 '25 01:12

Tobbe


Try clearing your cache by running either:

  • npm cache clean --force (built-in)

  • npx clear-npx-cache

After that, retry npx create-react-flask foobar

like image 21
Loiter Avatar answered Dec 04 '25 23:12

Loiter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!