Error: EBADF, bad file descriptor when running node using nohup of forever

javabeangrinder picture javabeangrinder · May 17, 2013 · Viewed 14k times · Source

I have a problem with node.js running a small web server serving files from the file system. When starting it with node server.js it works like a charm but when starting it with nohup or forever node.js can't find the files.

Answer

forzagreen picture forzagreen · Aug 1, 2016

This works for me:

nohup node server.js </dev/null