0

I'm struggling to get a simple node application to run on IIS using iisnode. Here is the application:

var http = require('http');

http.createServer(function (req, res) {
    res.writeHead(200, {'Content-Type': 'text/html'});
    res.end('Hello, world! [helloworld sample; iisnode version is ' +
        process.env.IISNODE_VERSION + ', node version is ' + 
        process.version + ']');
}).listen(process.env.PORT);  

Here is the error that I'm getting:

Application has thrown an uncaught exception and is terminated:
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> (C:\Program Files\iisnode\www\helloworld\hello.js:6: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 Module.require (module.js:364:17)

Because this is on my dev box I've given the app_pool superuser privileges but that hasn't helped.

Guy
  • 65,082
  • 97
  • 254
  • 325
  • Do you have any firewell installed? – thefourtheye Oct 06 '13 at 07:19
  • Not familiar with Windows/IIS, but could the port be a privileged one that requires administrator rights? – robertklep Oct 06 '13 at 07:27
  • Is it possible something else is already running on that port? – ksimons Oct 06 '13 at 07:33
  • @thefourtheye - yes but I'm inside the firewall – Guy Oct 06 '13 at 16:30
  • @robertklep - yes, but I'm running the app pool with full admin rights. – Guy Oct 06 '13 at 16:31
  • @ksimons - IIS is managing port 80 which is what this is running on. My understanding is that iisnode will use this port by being hosted by IIS. I could be wrong... – Guy Oct 06 '13 at 16:32
  • And if you try port 81 or 8080? – ksimons Oct 06 '13 at 16:34
  • @ksimons Same result on port 3000. – Guy Oct 07 '13 at 02:06
  • Do you know that your process.env.PORT is set to 80? You could try hard coding the port to 80 and see if it works. IISNode allows you to have node listen to the same port as IIS is serving, which is nice if you need to host node along side as IIS web server. – Svbaker Oct 10 '13 at 11:25
  • @Svbaker - Yes, tried setting process.env.PORT and also hard coding it. Thanks. – Guy Oct 11 '13 at 15:25
  • AFAIK, in iisnode, process.env.PORT is a named pipe. For what it is worth, on my dev box, the AppPool runs in .Net 4.0, Integrated, as LocalSystem. Also, you may have a look at your site bindings. Perhaps there are restrictions on some hostname/type/port – jbl Oct 17 '13 at 12:21
  • possible duplicate of [socket.io.js not found on client](http://stackoverflow.com/questions/19361974/socket-io-js-not-found-on-client) – Paul Sweatte Apr 30 '14 at 15:44

0 Answers0