Shinji035
Shinji035

Reputation: 361

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

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?

Upvotes: 2

Views: 15140

Answers (2)

azr
azr

Reputation: 1

Simplest solution:

Simply run npm init and it will walk you through the process of creating package.json file

Upvotes: 0

Henry
Henry

Reputation: 43728

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

Upvotes: 1

Related Questions