node-js-1

Hummm, so I downloaded the file Windows Installer (msi) for 64bit for Windows from http://nodejs.org/download/ and ran the installation, but here’s the thing I can open and run the Node.js command prompt and at first it looks fine. It will even accept a line saying:

mate app.js

At which point it seems to go into some sort of editor mode with 3 dots ‘…’ before the cursor but whenever I type in a small test program and perform anything to check that Node.js is working web pages time out and the command line returns an error something like this:

I have looked at a post on stack exchange where one user suggests it might be a firewall setting, so I have specifically added Node.exe to Windows Firewall and enabled it to pass through – so it’s not that.

This answer by¬†Brian McGinity states ” Look in Windows Firewall with Advanced Security and see if Evented I/O for V8 JavaScript is blocked or appears two times.”

To be honest I didn’t really understand what he meant. It wasn’t until I decided to uninstall and reinstall Node.js that I saw this window pop-up.

evented-io-for-v8-javascript

That I realised Evented I/O for V8 JavaScript (which wasn’t listed in Windows Firewall at all that I realised I needed to add this program and enable it to pass through the firewall.

 

Also commands from my regular shell such as:

npm install -g stream-handbook

Work perfectly… However if I try a simple program like this:


var http = require('http');
http.createServer(function(request, response){
response.writeHead({
. 'Content-Type':'text/plain'
. });
response.end('Greetings you super cool Earthling');
}).listen(8080);