2

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).

Alexei Levenkov
  • 96,782
  • 12
  • 124
  • 169
Daniel Arnost
  • 67
  • 1
  • 1
  • 7

2 Answers2

7

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

Samuel Liew
  • 72,637
  • 105
  • 156
  • 238
Kenneth Ngigi
  • 79
  • 1
  • 4
0

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
jonilyn2730
  • 385
  • 8
  • 20