I'm following a tutorial in a angularJS book and have to setup a server. This is the server.js file:
var express = require('express');
var app = express();
app.use('/', express.static('./'));
app.listen(80);
I get this error:
$ node server.js
events.js:154
throw er; // Unhandled 'error' event
^
Error: listen EACCES 0.0.0.0:80
I know already, that the Error EACCES means that i don't have access rights to the port 80, but i don't know how to fix this. Any help much appreciated!
app.listen(8080)
or start the server as root,sudo node server.js
. – Claarroot
(or similar) to open the ports below 1024. So your choices are pick a port above 1024 or, if you have the permissions, run your code asroot
. – Penny