6

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

3 Answers 3

5

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.

1

In my case, I manually packaged some dependencies like this.

"@swf/pdfjs": "file:lib/swf-pdfjs-2.14.305c.tgz"

My mistake was in the package folder of the archived file, there was no package.json file for the dependency and after I repackaged it correctly it worked fine again.

0

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.