npm not working after clearing cache

前端 未结 11 965
南笙
南笙 2020-12-12 12:53

Before clearing cache

npm cache clear

npm is working fine. After clearing cache, it is not working. The error log below suggest problem wi

相关标签:
11条回答
  • 2020-12-12 13:24

    Try npm cache clean --force if it doesn't work then manually delete %appdata%\npm-cache folder.

    and install npm install npm@latest -g

    It worked for me.

    visit this link

    0 讨论(0)
  • 2020-12-12 13:27

    I solved this issue by running cmd as an administrator. before that, I was trying to run in vs code.

    run it in Power Shell or Cmd with administrative privilege. I hope that it will help.

    npm install –g @angular/cli@latest
    
    0 讨论(0)
  • 2020-12-12 13:29

    It should be

    npm cache clean  
    

    See https://docs.npmjs.com/cli/cache.html

    0 讨论(0)
  • 2020-12-12 13:30

    I try to

    npm cache clean 
    

    But npm said newer version on npm (> 5) has self healing Mechanism and every thing i need to do for checking npm is use verify

    npm cache verify
    

    npm message :

    The npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. 
    
    If you want to make sure everything is consistent, use 'npm cache verify' instead.
    

    but for forcing npm use this:

    npm cache clean --force
    
    0 讨论(0)
  • 2020-12-12 13:32

    Try npm cache clean --force if it doesn't work then manually delete %appdata%\npm-cache folder.

    It worked for me.

    0 讨论(0)
提交回复
热议问题