Max
Max

Reputation: 868

Node: Error: ENOENT, readdir

I've been trying to build a nodejs project on my local machine, and when I go to build it from the terminal it throws a string of text out, the last bit of which is the error message below:

starting { [Error: ENOENT, readdir '/Users/Max/github/project/mweb/sites']
  errno: 34,
  code: 'ENOENT',
  path: '/Users/Max/github/project/mweb/sites' } Error: ENOENT,
  readdir '/Users/Max/github/project/mweb/sites'

My goal in posting this error message here was to ask if anyone by chance knows what it means? I did a quick few google searches and I didn't find much of an explanation online. I realize I didn't give very much information, but does anyone have any idea what might cause this kind of error, specifically the part about:

readdir '/Users/Max/github/project/mweb/sites'

If you can provide some kind of insight, I would greatly appreciate it!

Upvotes: 0

Views: 2136

Answers (2)

Seth Holladay
Seth Holladay

Reputation: 9539

ENOENT is short for "Error, no entry."

Node is telling you that the program expected a directory at /Users/Max/github/project/mweb/sites but could not find it.

It is hard to say for certain why the program is expecting that to be a directory, but since you are trying to build a project, most likely it wanted to write some files to the disk under that location. Files cannot be written inside of a non-existent directory and unless the programmer actively handles this condition, it will crash.

You could make a directory there yourself:

mkdir /Users/Max/github/project/mweb/sites

However, other errors will likely appear after this one is fixed, because something about your environment is different than what the project expects. Have a look at the README of the project. Maybe there are some prerequisites that you missed.

One possibility is that your current working directory is wrong according to the project's instructions. This can cause paths to be computed incorrectly. Typically you want to be at the root of a project when building it.

You can determine your current working directory by running pwd.

Upvotes: 1

Papa_D
Papa_D

Reputation: 11

I believe what is happening is the path declaration is wrong. Try './Users/Max/github/project/mweb/sites'

See Also Node JS Error: ENOENT

Upvotes: 1

Related Questions