Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

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.

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.