Daniel Arnost
Daniel Arnost

Reputation: 87

How does one properly do npm cache clean?

I start from my root directory or my project directory and enter npm cache clean/clear (I have tried both and nothing seems to happen.)

Anyone know how completely clear the cache for npm? Basically I need to run webpack (using as a react npm package) and it used to work and now does not. Does anyone know how to properly npm cache clean and in which directory to do this?


Additionally I also read something about your environment PATH variable needing to be correct for cleaning cache and I somehow screwed that up. Under PATH it now seems to have combined two paths, one for my mongoDB and one for npm, both chained together with following value:

PATH    C:\Program Files\MongoDB\Server\3.2\binC:\Users\test\AppData\Roaming\npm

Would invalid PATH be a problem (npm itself runs ok) for cleaning cache? (I'll fix PATH with Adding directory to PATH Environment Variable in Windows).

Upvotes: 4

Views: 23189

Answers (2)

Kenneth Ngigi
Kenneth Ngigi

Reputation: 129

This command will force clean the entire NPM cache:

npm cache clean --force   

Check this NPM documentation link for more information on clearing the NPM cache: https://docs.npmjs.com/troubleshooting/try-clearing-the-npm-cache

Upvotes: 12

jonilyn2730
jonilyn2730

Reputation: 475

I think you might need a semicolon between each path sir

C:\Program Files\MongoDB\Server\3.2\bin; C:\Users\test\AppData\Roaming\npm

Upvotes: 0

Related Questions