Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need to sudo before starting server in ch01 #2

Open
ktomazin opened this issue Mar 17, 2015 · 2 comments
Open

Need to sudo before starting server in ch01 #2

ktomazin opened this issue Mar 17, 2015 · 2 comments

Comments

@ktomazin
Copy link

I get the following error when attempting to start the server:
bash-3.2$ node server.js
events.js:85
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1112:19)
at listen (net.js:1155:10)
at Server.listen (net.js:1240:5)
at Function.app.listen (/Users/ken.tomazin/IdeaProjects/learning-angularjs-master 2/node_modules/express/lib/application.js:536:24)
at Object. (/Users/ken.tomazin/IdeaProjects/learning-angularjs-master 2/server.js:4:5)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)

The issue is that we are trying to connect on port 80 and you need to sudo on a unix system before doing that:

sudo node server.js

@andyhqtran
Copy link

@nmarler
Copy link

nmarler commented Feb 16, 2016

I think very similar issue on Windows machine, although different error. Running from an Administrator command prompt:

node server.js
events.js:154
throw er; // Unhandled 'error' event
^
Error: listen EACCESS 0.0.0.0:80

Found item below on SO which suggesting using port >1024. I used port 8080 which solved the problem (specifically, edit line 4 of server.js to be: app.listen(8080);)

http://stackoverflow.com/q/35068712/1073908

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants