Since this post has gotten a lot of attention over the years, I\'ve listed the top solutions per platform at the bottom of this post.
Original post
For people using newer versions of the daemon npm module - you need to pass file descriptors instead of strings:
var fs = require('fs'); var stdoutFd = fs.openSync('output.log', 'a'); var stderrFd = fs.openSync('errors.log', 'a'); require('daemon')({ stdout: stdoutFd, stderr: stderrFd });