0
votes

I am new to NodeJS. I tried using my node js application in my local machine, with installing forever module, script runs continuously But when I deploy my application in VPS(Godaddy). Node application runs fine. I tried installing forever inorder to run my script continuously, with command

npm install forever -g.

It installs the module but when trying to run it with command

forever start app.js

says forever command not found. Can anyone guide me what am I doing wrong? Any help will be appreciated.

1
Did you look at where forever was installed and then see if you have a path to that directory? - jfriend00
Can you please suggest me how to check that? - DeJavu
What OS is your GoDaddy VPS? - jfriend00
@jfriend00 Its CentOS 6 - DeJavu
I'm not an experienced Linux guy myself, but a little work with Google shows this wikihow.com/Find-a-File-in-Linux and digitalocean.com/community/tutorials/… - jfriend00

1 Answers

2
votes

You should check with npm list -g if the module is listed.

Other way to check it is to go to a bash console and type ls /usr/local/lib/node_modules | grep forever and check if the module is there.

If it's not there, something went wrong installing the module. Install it again with sudo npm install -g forever.

Check with printenv | egrep -o "(.*node*) in the bash console and see if you have "NODE_PATH=/opt/lib/node_modules".

If not export NODE_PATH=/opt/lib/node_modules int the console and try again the forever command forever start app.js.