"forever list" says "No forever process running" but it is running an app

13,611

Solution 1

i had the same problem today.

in my case: i'm using NVM and forgot that it doesn't set/modify the global node path, so i had to set it manually

export NODE_PATH="/root/.nvm/v0.6.0/bin/node"

Solution 2

forever list should be invoked with same user as that of processes. Generally it is root user (in case of ubuntu upstart unless specified) so you can switch to root user using sudo su and then try forever list.

PS. Moved to pm2 recently which has lot more features than forever.

Solution 3

If you exec the forever start app.js within init.d you should later type sudo HOME=/home/pi/devel/web-app -u root forever list to have the correct list.

Solution 4

A fix would be great for this.
Encountered this one as well.
I believe an this issue was logged here.
What I could recommend for now is to find the process that's using your node port e.g. 3000. Like so:

sudo lsof -t -i:3000

That command will show the process id.
Then kill the process by performing:

kill PID
Share:
13,611

Related videos on Youtube

jwchang
Author by

jwchang

.

Updated on June 04, 2022

Comments

  • jwchang
    jwchang almost 2 years

    I have started an app with

    forever start app.js
    

    After that I typed,

    forever list
    

    and it shows that

    The "sys" module is now called "util". It should have a similar interface.
    info:   No forever processes running
    

    But I checked my processes with

    ps aux | grep node
    

    and it shows that

    root      1184  0.1  1.5 642916  9672 ?        Ss   05:37   0:00 node     
    /usr/local/bin/forever start app.js
    root      1185  0.1  2.1 641408 13200 ?        Sl   05:37   0:00 node 
    /var/www/app.js
    ubuntu    1217  0.0  0.1   7928  1060 pts/0    S+   05:41   0:00 grep --color=auto node
    

    I cannot control over the process, since I cannot list the process in "forever list"

    How can I let "Forever" knowing its running processes and let having control over its running processes.

    • staackuser2
      staackuser2 over 12 years
      Are you running forever list as root as well?
    • staackuser2
      staackuser2
      You should have some info in ~/.forever or in your case /root/.forever. So it doesn't matter what directory you are in, but what user you are.
  • superhawk610
    superhawk610 about 3 years
    HOME=/root shouldn't be necessary, sudo already runs the command as the root user.
  • Farrukh Taqveem Haider
    Farrukh Taqveem Haider about 3 years
    Both gave different results in my case.