0

I'm running the below on server startup:

exec sudo -E -u www-data /usr/bin/node /etc/nodeserver/app.js >> /var/log/applicationserver.log 2>&1

The console writes many messages that the start exited with the code 2. The application is still started in the end.

Where can I find information about the exit codes for nodejs?

2 Answers 2

1

I am not using node.js, so please take this with a grain of salt.

However I looked up reserved exit codes for Unix in general, and Code 2 seems to be similar to Code 1 (general error).

You could try node with a trivial program, and therefore see if it also emits the same row of error messages. It could be the app.js that displays these messages. Does node have a man page? It generally includes the exit codes the program uses.

Also I've searched for ways to exit a process in node with an exit code, and the right way to do this seems to be the process object.

0

I had the same error with /usr/sbin/node being used instead of /usr/bin/node. I just removed /usr/sbin/node

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .