Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Node.js with Forever on ubuntu

I'm trying to install Forever to use with Node.js. I'm installing it using 'npm install forever -g'. It seems to install fine, but when I run the command 'forever' it's not found.

Maybe I'm not installing it in the right location? Where should it be installed to?

Any help would be great! Thank you!

like image 859
dzm Avatar asked Mar 08 '12 04:03

dzm


People also ask

How do I make node js run forever?

js application locally after closing the terminal or Application, to run the nodeJS application permanently. We use NPM modules such as forever or PM2 to ensure that a given script runs continuously. NPM is a Default Package manager for Node.

Why do you use forever with node js?

Forever is an npm module that ensures a Node. js script continuously runs in the background on the server. It's a helpful CLI tool for the production environment because it helps manage the Node applications and their processes.

How do I run npm forever?

What is npm forever? Forever is an npm package used to keep your script running continuously in the background. It's a handy CLI tool that helps you to manage your application in the development and production stages. To start running a script with forever, use the forever start command, followed by the script name.


2 Answers

You have to run forever install using sudo:

sudo npm install forever -g
like image 109
griffon vulture Avatar answered Oct 08 '22 18:10

griffon vulture


That should work, but check 'npm bin -g' to make sure that directory is on your path.

like image 21
mike__t Avatar answered Oct 08 '22 16:10

mike__t