I need to make my local node.js webapp listen 80 port. Now if run my app on port 80 I get this erro
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at errnoException (net.js:901:11)
at Server._listen2 (net.js:1020:19)
at listen (net.js:1061:10)
at Server.listen (net.js:1127:5)
at Object.<anonymous> (\scripts\server.js:23:4)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
And if run app on 4321 port this error do not reproduced, so it's port depending.
What should I do to be able run my app on port 80 on Windows 7
We know that most of the time we want our node applications to listen on port 80. While it is a widely used technique and many times we don't need anything else then just simply mentioning the port as 80 in our project configurations.
const server = http. createServer((req,res)=>{ // Handle request and response }); Specify Port Number and hostname and set the server to listen to it. server.
On windows machine you 80 port probably busy with IIS Server. Try to stop iis first and after run node.js webapp with port 80.
IIS on 80 port is definitely issue. And instead of turning it of you can try IIS node. http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx Probably you don't need port 80 in local development at all, but if you go in production on Windows machine IIS Node is good choice to load balance.
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