Questions tagged [forever]

Forever is a Node.js package that ensures a script continues to run. Do not use this tag for everlasting conditions, loops, animations, …

Forever is a command-line node.js package that ensures a script continues to run. It logs the console and can restart a script a specified number of times (it will not restart on continued errors).

Links

620 questions
493
votes
23 answers

How to run a shell script at startup

On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my Node.js application). I use these scripts to manually start and stop my Node.js application. So far so…
meetamit
  • 24,727
  • 9
  • 57
  • 68
199
votes
16 answers

Automatically start forever (node) on system restart

I am using node's forever module to keep my node server running. Forever however terminates when there is a system restart. Is there any way I can automatically start the node server (with forever) when the system restarts?
kehers
  • 4,076
  • 3
  • 30
  • 31
118
votes
11 answers

Where does forever store console.log output?

I installed forever and am using it, finding it quite funny. But I realized that the logs are placed to somewhere else. Is there any tips?
AGamePlayer
  • 7,404
  • 19
  • 62
  • 119
109
votes
3 answers

Node forever /usr/bin/env: node: No such file or directory

I have installed nodejs using: apt-get install nodejs Then i have installed npm using: apt-get install npm And then i have installed forever using: npm install forever -g Now i go to my project /var/www/myproject and attempt to run forever start…
Marc Rasmussen
  • 19,771
  • 79
  • 203
  • 364
104
votes
11 answers

How to pass execution arguments to app using PM2?

I am using pm2 to start my app but I'm not able to pass argument to it. The command I am using is pm2 start app.js -- dev. Though this works with forever.
user3373581
  • 1,141
  • 2
  • 7
  • 11
79
votes
3 answers

How to have css3 animation to loop forever

I want to have the whole set of animation to play forever. When the last photo fades off, I want the first one to appear again an so on. What I did (and I dont like) is set the page to reload at the end of the last photo fade out. Is there any other…
CuRSoR
  • 801
  • 1
  • 6
  • 3
53
votes
9 answers

Forever + Nodemon running together

Is there any way to have both of this packages running together? So basically I want to have best from both worlds. Running server automatically (and restarting when there is an error) and also automatic updates when there is .js file change…
Patrik Fuhrmann
  • 969
  • 1
  • 12
  • 21
46
votes
2 answers

Node.js forever with environment variable

The command I run on my server to start my node app is: sudo IS_PROD=1 node app.js I have forever installed but can't seem to pass in the environment variable. sudo IS_PROD=1 forever node app.js Doesn't seem to do the trick. I have tried several…
user1168427
  • 1,003
  • 3
  • 10
  • 16
43
votes
8 answers

Forever: command not found

I am getting a forever: command not found error when I run a nodejs process using the forever command as a cronjob (in an amazon ec2 machine): the bash script I am using has the following code: cd to/location/of/the/nodejs/file forever start…
azero0
  • 2,220
  • 3
  • 20
  • 31
40
votes
1 answer

What is the minUptime

I am using forever with my project. What do these options do: minUptime spinSleepTime I didn't understand from GitHub page.
Tolgay Toklar
  • 4,151
  • 8
  • 43
  • 73
29
votes
9 answers

Node.js - Unable to run node server using forever

I am trying to run node server using forever command. I installed forever globally using: npm install forever -g After installing forever I try to run my node script by using below command: node_modules\.bin\forever start app.js Below is my…
S Singh
  • 1,403
  • 9
  • 31
  • 47
28
votes
4 answers

Hide child process console window

When spawning a new child in nodejs on windows (child_process.spawn) it always opens a blank console window which stays open until the child process ends. Is there a way to avoid this? i.e. we want to run our application as a background service…
ronag
  • 49,529
  • 25
  • 126
  • 221
27
votes
5 answers

NodeJS Forever package minUptime and spinSleepTime warnings

I'm trying to run the forever function for node.js but I get below warnings; C:\serv>forever start SERVER.js warn: --minUptime not set. Defaulting to: 1000ms warn: --spinSleepTime not set. Your script will exit if it does not stay up f or at…
John
  • 271
  • 1
  • 3
  • 5
25
votes
3 answers

What is forever in nodejs?

I am having hard time understanding what is forever in nodejs. Can someone explain what is forever in simplest way that i can understand and what is the purpose of it
Agent69
  • 648
  • 1
  • 8
  • 16
24
votes
6 answers

Node JS auto restart all forever JS process when server goes down / crashes

I am using forever js to keep my node server running 24/7 on AWS EC2. I use this command forever start index.js However, I notice that some time it randomly stops the process and my site goes down. I have to manually ssh into my server to run it…
Faizan
  • 1,847
  • 8
  • 40
  • 63
1
2 3
41 42