NPM cant find file it thinks is cached (errno -4058 no such file or directory)

Viewed 697

I try to do npm install with a git directory, i get this every time.

npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path C:\Users\User\AppData\Local\npm-cache\_cacache\tmp\git-clone-4622a2ff/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\User\AppData\Local\npm-cache\_cacache\tmp\git-clone-4622a2ff\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

I tried:

  • npm cache clean -f
  • npm cache verify
  • deleting the whole npm-cache folder in both local and roaming app data
  • npm install npm@latest -g
2 Answers

I had a similar problem when I tried installing a git dependency with npm install. The problem was the git dependency didn't have a package.json file. Generating a package.json file into the git dependency fixed the problem for me.

I uninstalled node completely, deleted all npm folders in appdata. Reinstalled node. Then it worked enough to give me a different error.

Related