npm install error: 'ENOENT: no such file or directory'

Issue

I donwload a project form somewhere , and I run ‘npm install’ , I got this:

npm ERR! path /Users/<username>/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open '/Users/<username>/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

but I have checked the project , there were a package.json file there:
/Users/username/Desktop/Directory/Projects/ProjectName/package.json

do I need to use npm init to create another one?

Solution

cd to the directory where package.json is (/Users/username/Desktop/Directory/Projects/ProjectName/ in your case) and run npm install again.

Answered By – Henry

Answer Checked By – David Marino (AngularFixing Volunteer)

Leave a Reply

Your email address will not be published.