reset password
Author Message
venny
Posts: 61
Posted 15:36 Nov 14, 2016 |

When I put down:

app.listen(2000);

It works when I go to localhost:2000

 

But when I try to run

app.listen(80).

 I get an error

 

events.js:154

      throw er; // Unhandled 'error' event

      ^

 

Error: listen EACCES 0.0.0.0:80

    at Object.exports._errnoException (util.js:856:11)

    at exports._exceptionWithHostPort (util.js:879:20)

    at Server._listen2 (net.js:1223:19)

    at listen (net.js:1272:10)

    at Server.listen (net.js:1368:5)

    at EventEmitter.listen (/Users/ashleyvo/node_modules/express/lib/application.js:617:24)

    at Object.<anonymous> (/Users/ashleyvo/Desktop/programming paradigms class/hw3/server.js:59:5)

    at Module._compile (module.js:413:34)

    at Object.Module._extensions..js (module.js:422:10)

    at Module.load (module.js:357:32)

msargent
Posts: 519
Posted 15:38 Nov 14, 2016 |

Try 8080.

wveit
Posts: 18
Posted 16:55 Nov 14, 2016 |

Is it at all possible that you have another web server running? Such as apache tomcat or apache server... as part of your projects from another class or personal projects? Or maybe a different nodejs server that was running on that same port but wasn't shut down? My understanding is that you cannot have more than one server operating on the same port. Does that sound right Professor Sargent?

Also you may be able to get better information about the problem if you catch the error with a try catch block and print it.

Good luck!

msargent
Posts: 519
Posted 16:58 Nov 14, 2016 |

That does. Are you working on your Java web programming class at the same time, and have your Tomcat server running?

wveit
Posts: 18
Posted 17:26 Nov 14, 2016 |

I guess one way you could rule out the possibility of another server using that port would be to restart the machine. That should shutdown any running servers. Then if you still get the same error when running your project, we'll know it's a different problem.

venny
Posts: 61
Posted 18:19 Nov 14, 2016 |

I definitely do not have a tomcat working.  Not in that class.