7

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!

dzm
  • 22,844
  • 47
  • 146
  • 226

2 Answers2

9

You have to run forever install using sudo:

sudo npm install forever -g
griffon vulture
  • 6,594
  • 6
  • 36
  • 57
7

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

mike__t
  • 979
  • 5
  • 6
  • It's not included there. I see express, node, node-waf and npm. I don't see socket.io either (if I'm suppose to), but socket.io is working. What path should I run npm install from? I know it creates node_modules in whatever path I run it in. – dzm Mar 08 '12 at 04:36
  • Do you run npm install with 'sudo'? It shouldn't matter which directory you're in if you use '-g', but I usually switch to a directory without a 'node_modules' just to make sure it doesn't go there. You won't see anything from socket_io in the bin directory; it doesn't install any tools like that. – mike__t Mar 08 '12 at 05:04
  • Well, I just ran it again and it worked. Who knows! Thanks :) – dzm Mar 08 '12 at 05:49
  • 2
    i ran "npm install forever" and it was giving forever not found and then i ran "sudo npm install forever -g " and it worked fine. – peter Mar 14 '13 at 05:36