Azoulay Jason Azoulay Jason - 3 years ago 406
Node.js Question

npm ERR! Refusing to delete

I'm just running a simple

npm install
and i get this weird error.

npm ERR! path /Users/jasonazoulay/Desktop/
npm ERR! code EEXIST
npm ERR! Refusing to delete /Users/jasonazoulay/Desktop/ is outside /Users/jasonazoulay/Desktop/ and not a link
npm ERR! File exists: /Users/jasonazoulay/Desktop/
npm ERR! Move it away, and try again

It tells me to move a file but I don't know if i should touch a node_modules file.
This is the first time I get this kind of error and I don't know what to do . I also found nothing about this.

Answer Source

Try running npm update -g npm then run npm i again.
If that doesn't work maybe npm cache clean helps.

If that doesn't work either you should consider removing the node_modules folder in your application and running npm i again.
If you still have no luck, I suggest removing the package-lock.json and the node_modules folder before running npm i.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download