http://stackoverflow.com/a/27026780/2177408
ENOENT
typically means the file/directory doesn't exist
Check your path. If you were making multiple levels of directories, you will usually get this.
For example. if you need to mkdir('public/projects'), make sure you mkdir('public') first then mkdir('public/projects')
Just some sample scripts to demo:
var fs = require('fs');
var f = '/css/colors';
var dirs = f.split('/');
var newDir = __dirname;
for (var i = 0; i < dirs.length; i++) {
newDir += dirs[i] + '/';
console.log(newDir);
if (!fs.exists(newDir)) {
fs.mkdir(newDir, function(error) {
console.log(error);
})
}
}