Using fs.readdir and fs.statSync returns ENOENT, no such file or directory error
This works: var promise = new Future(), dirs = [], stat; Fs.readdir(Root + p, function(error, files){ _.each(files, function(file) { //stat = Fs.statSync(file); //if ( stat.isDirectory() ) { dirs.push(file); //} }); promise.return(dirs); }); This does not: var promise = new Future(), dirs = [], stat; Fs.readdir(Root + p, function(error, files){ _.each(files, function(file) { stat = Fs.statSync(file); if ( stat.isDirectory() ) { dirs.push(file); } }); promise.return(dirs); }); Resulting in "Error: ENOENT, no such file or directory 'fonts'" fonts is the first directory in the tree, and it does