0

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!

Max
  • 633
  • 6
  • 21
  • 1
    http://stackoverflow.com/questions/25093276/nodejs-windows-error-enoent-stat-c-users-rt-appdata-roaming-npm – user2717954 Oct 23 '14 at 06:41
  • 1
    When you say "build it from the terminal", what do you mean? A node project doesn't have to have a typical "build" step since there's no compile required as JS files are just plain text. So, what does "build it from the terminal" mean? It looks to me like something expects `'/Users/Max/github/project/mweb/sites'` to exist and it doesn't. `ENOENT` means something is looking for a directory entry in the file system and is not finding it. – jfriend00 Oct 23 '14 at 07:44

2 Answers2

1

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

See Also Node JS Error: ENOENT

Community
  • 1
  • 1
Papa_D
  • 11
  • 2
1

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.

Seth Holladay
  • 6,356
  • 2
  • 23
  • 38