joyent/node — Issue #2211: Errorcode EEXIST wrong on mkdirSync (47 instead of 17)
Author: mauritslamers
Created: 2011-11-28 09:59:07+00:00
State: open

When trying to create a new directory with mkdirSync, and the directory already exists, the error object thrown has an inconsistency:

{ [Error: EEXIST, file already exists 'build'] errno: 47, code: 'EEXIST', path: 'build', syscall: 'mkdir' }

The issue is that the errno is wrong, as 47 is the error for EAFNOSUPPORT.
The constants give 17 for EEXIST.

Tested on MacOSX and Centos (tanepiper).