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%
odejs
ren npm.cmd npm2.cmd
ren npm npm2 
npm2 install npm@latest -g

del npm2
del npm2.cmd

Rolf-schmidiger

本文转自:https://stackoverflow.com/questions/46541371/npm-err-refusing-to-delete-code-eexist?from=singlemessage

原文地址:https://www.cnblogs.com/nizuimeiabc1/p/12153219.html