It doesn't sound like you're really solving the problem... But you could use a crob job.
Something like:
0 */4 * * * forever restart <MYSCRIPT.JS>
Question
How can I automatically restart my node js server every 4 hours automatically. There is a bug that only shows up after 4 hours and I want to be able to run it through the night. I'm already using forever. Thanks, Arjun
La solution
It doesn't sound like you're really solving the problem... But you could use a crob job.
Something like:
0 */4 * * * forever restart <MYSCRIPT.JS>