nodejs: listen EACCES: permission denied 0.0.0.0:80

Non-privileged user (not root) can't open a listening socket on ports below 1024.

Check this

Give Safe User Permission To Use Port 80

Remember, we do NOT want to run your applications as the root user, but there is a hitch: your safe user does not have permission to use the default HTTP port (80). You goal is to be able to publish a website that visitors can use by navigating to an easy to use URL like http://ip:port/

Unfortunately, unless you sign on as root, you’ll normally have to use a URL like http://ip:port - where port number > 1024.

A lot of people get stuck here, but the solution is easy. There a few options but this is the one I like. Type the following commands:

> sudo apt-get install libcap2-bin 
> sudo setcap cap_net_bind_service=+ep `readlink -f \`which node\`` 

Now, when you tell a Node application that you want it to run on port 80, it will not complain.

EDIT: Add a space in the setcap command


I believe you need root privileges to run on ports below 1024.

sudo node app.js

If you do not have a sudo account, try using other ports, 8080 and 4433 for example.