Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete the localy installed version of npx command?

When I execute a command with npx, npx propose me to install a version locally.

Example

npx matcha-stock -s=MSFT

If the version is updated on npm.org, npx gives me only the version installed locally and doesn't check if an updated version exists.

If I execute

npx matcha-stock@latest -s=MSFT

I get the latest version of the tool.

But, if I execute again

npx matcha-stock -s=MSFT

I got the previous installation.

Question: How to uninstall, clear the cache of the locally installed version of the command ?

#npx #NPM

like image 880
Raphael Mansuy Avatar asked Jan 27 '26 16:01

Raphael Mansuy


1 Answers

The dependencies of each of these commands are stored in a cache at .npm/_npx/*/node_modules, when I tried blowing all those away it worked.

Finding which one to delete

ls ~/.npm/_npx/*/node_modules | grep matcha-stock

Just deleting them all

rm -r ~/.npm/_npx/
like image 197
Thomas Avatar answered Jan 29 '26 05:01

Thomas



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!