Node.js Timeout Forever.js

I am running a node script in my EC2 instance. I use forever.js to launch it, because I would like to launch it even when I disconnect from my SSH connection.

I run:

forever start app.js 

and then list the running processes using:

 forever list 

and for uptime says STOPPED no matter what i do.

 ubuntu@ip-xx-xxx-xxx-xxx :~$ forever list info: Forever processes running data: uid command script forever pid id logfile uptime data: [0] 79f1 /usr/local/bin/node app.js 17099 17100 /home/ubuntu/.forever/79f1.log STOPPED 
+4
source share
2 answers

I checked the specified log file (duh!) /home/ubuntu/.forever/79f1.log and had an error.

Turns out it was a simple path error in my app.js script. I used a file that was not in the same directory from which I was running forever start app.js So this actually had nothing to do with forever.js, but it was a simple path error where node could not find the file. Thanks for the log files!

+2
source

You can simply run forever logs yourfile.js to view the logs. If you need to make sure that you see the correct logs.

enter image description here

+2
source

All Articles