I am new to nodejs. Started learning with this simple program .
var http=require("http");
var host="127.0.0.1";
var port=10016;
var server=http.createServer(function(request, responce) {
console.log("Request recieved : " + request.url);
responce.writeHead(200, {"Content-type":"text/plain"});
responce.write("Hello World.! This is the start of my journey in nodejs");
responce.end();
});
server.listen(host, port, function() {
console.log("Listening "+ host +":" + port)});
When I run the program using "node server.js " I encounter this error which , although I surfed, I could not find any relevant explanations apart from using different ports. I tried as many as any . I am a windows user. Mac users might have sudo with root permissions, but the problem isnt the same. Please help. Thanks in advance.
My error is : C:\node>node firstserver.js
events.js:72
throw er; // Unhandled 'error' event
^
Error: listen EACCES
at errnoException (net.js:904:11)
at Server._listen2 (net.js:1023:19)
at listen (net.js:1064:10)
at Server.listen (net.js:1132:5)
at Object.<anonymous> (C:\node\firstserver.js:12:8)
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)
Help appreciated.!