Can't install any NPM package, error 4058

Try these steps:

  • Delete package-lock.json and run NPM again.
  • Ensure no other processes of node.js are running (check task manager)
  • If you are using visual studio code, close it and try running npm install again.
  • If all else fails, restart your computer.

See thread here: https://github.com/npm/npm/issues/17444


For me the reason was Dropbox (my NodeJS project being somewhere deep in the Dropbox folder). I suspended the synchronisation, tried npm install again and it installed without error. Then of course I resumed the synchronisation.


you should not forget to goto the project folder by cd "nameofproject" and then "npm start" is work.