Don't call parseInt() in calls to mkdirSync() because it'll treat as base10 instead of octal.  Just pass octal numbers.