0

I have a nodeJS server that I want to run forever.

I found this package https://github.com/foreverjs/forever

I installed it using this command line sudo npm install forever -g

But when I test it, there is no output (even not for help).

enter image description here

What it can be?

Nir
  • 1,882
  • 4
  • 26
  • 44

1 Answers1

0

If you installed on Ubuntu through apt package manager you need to create a symbolic link since npm modules try to run via /usr/bin/node

sudo ln -s `which nodejs` /usr/bin/node

or automatically via apt

sudo apt-get install nodejs-legacy
Carlos Sultana
  • 709
  • 5
  • 11
  • I did this command sudo ln -s /usr/bin/nodejs /usr/bin/node and same result. – Nir Aug 24 '16 at 14:48
  • Do you get any output from `node --version` ? Also I would recommend updating npm to the latest version `sudo npm install -g npm` – Carlos Sultana Aug 24 '16 at 14:53
  • No output for the version, and it didn't help – Nir Aug 24 '16 at 14:56
  • if `nodejs --version` does give an output it means the symlink hasn't worked, you could try apt-get install nodejs-legacy to automatically make this for you. If this still doesn't work I would recommend the NVM route suggested in this post https://stackoverflow.com/questions/21168141/cannot-install-packages-using-node-package-manager-in-ubuntu – Carlos Sultana Aug 24 '16 at 15:02
  • Thanks. apt-get install nodejs-legacy helped! – Nir Aug 24 '16 at 15:05
  • Glad to help :) Please can you accept my answer if your issue is resolved – Carlos Sultana Aug 24 '16 at 15:08