I'm writing a node application and I recently switched from port 3000 to port 80 on my Mac Os X Lion machine (running 10.7.4) and whenever I run node server.js I get the following error
events.js:66
throw arguments[1]; // Unhandled 'error' event
^
Error: listen EACCES
at errnoException (net.js:768:11)
at HTTPServer.Server._listen2 (net.js:891:19)
at listen (net.js:935:10)
at HTTPServer.Server.listen (net.js:984:5)
at Object.<anonymous> (/Users/ajain/Documents/Projects/Time-Feed/server.js:127:5)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
Any idea on what I have to do to fix the issue?
You need to have the root privilege in order to listen on a port number below 1024. Therefore, you may use the sudo
command.
sudo node server.js
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With