npm ERR! Refusing to delete / code EEXIST

This was how I solved mine after 'googling' around...

  • Navigate to the directory your node was installed in
  • rename your npm.cmd and npm files
  • Try run the installation again
  • If successful..delete the files you renamed earlier npm and npm.cmd
  • if not, :( :(

The cli commands here...in case you don't want to be renaming and stuffs

cd %ProgramFiles%\nodejs
ren npm.cmd npm2.cmd
ren npm npm2 
npm2 install npm@latest -g

del npm2
del npm2.cmd

Rolf-schmidiger


Steps

  1. Delete the node_modules directory completely.
  2. Run npm install again.

This should help.

Tags:

Node.Js

Npm