npm install of angular throws error: ENOTEMPTY

When I execute npm install I get the following error:

npm ERR! syscall rmdir
npm ERR! path /home/vagrant/development/wpp/app-web/wpp.web2/node_modules/npm/node_modules/.debug.DELETE/node_modules
npm ERR! errno -39
npm ERR! ENOTEMPTY: directory not empty, rmdir '/home/vagrant/development/wpp/app-web/wpp.web2/node_modules/npm/node_modules/.debug.DELETE/node_modules'

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/vagrant/.npm/_logs/2020-10-29T18_38_17_165Z-debug.log

What I already tried to resolve this:

  • delete node_modules folder
  • delete only npm folder inside node_modules
  • delete ~/.npm file
  • delete package-lock.json
  • run npm update
  • npm cache clear --force
  • npm install --save express body-parser --force (even though I don't know what it does)
  • sudo npm install
  • various combinations of the above

I'm running npm version 6.14.8 and node version 12.19.0

What can I do to resolve this?

1 answer

  • answered 2020-10-30 11:33 NDDTConti

    Turns out I was stupid: The folder was shared with my windows-system and that created some weird side-effect. Using another location solved it.