NodeJS script will not start when executed in seperate application

I have a separate application that runs a shell script called test.sh:

node server.js;   //listen on port 5555

the script works fine if I run it as root: ./test.sh?

Maybe...

  • a permissions error with nodejs?
  • nodejs script is crashing because it writes the server status to stdout but stdout doesnt exist?

thank you in advance...

use forever to run your node server Install forever through npm

npm install forever -g

You can configure logs to write your stdout

You can run your app as forever server.js

the same you can give in your .sh file also