Suddenly, nothing happens. The only thing I did was add a new file to the “controllers” folder and then delete it. What could be wrong? What does it mean?
node/last/test4/controllers/.DS_Store:1
^
module.js:311
throw err;
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:429:25)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Module.require (module.js:354:17)
at require (module.js:370:17)
at /Users/henrikpetersson81/node/last/test4/controllers.js:8:13
at Array.forEach (native)
at Object.oncomplete (node/last/test4/controllers.js:6:15)
controllers.js (nothing has changed in this file):
var fs = require('fs');
module.exports = function(app, service){
fs.readdir(__dirname + '/controllers', function(err, files){
if (err) throw err;
files.forEach(function(file){
var name = file.replace('.js', '');
require('./controllers/' + name)(app, service);
});
});
};
source
share