server.js tries to load the config via process.cwd() (line: 63) Unfortunately if you don't launch the node server within the working directory a wrong directory will be returned. In my case (Ubuntu-Server & initctl-script) only the root ("/") directory is returned.

A better solution would be to use the node variable __dirname:

var settings = vm.runInThisContext(fs.readFileSync(__dirname + '/nodejs.config.js'));

So the folder of server.js is returned (which is the same as the config file) instead of the working directory.

Comments

Anonymous’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.