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
  • 98,904
  • 14
  • 127
  • 179
Daniel Arnost
  • 67
  • 1
  • 1
  • 7

2 Answers2

8

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
  • 76,741
  • 107
  • 159
  • 260
Kenneth Ngigi
  • 89
  • 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
  • 465
  • 9
  • 21