0

I am trying to learn node.js and like many others, the first step is like How to run server written in js with Node.js

However, my problem is syntax problem? (as follows) problemo

server.js

var http = require('http');

http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, "127.0.0.1");

console.log('Server running at http://127.0.0.1:1337/');
Community
  • 1
  • 1

1 Answers1

2

That's a different program called Node. You may want to uninstall it, then install actual Node from here:https://nodejs.org/en/download/

Jason Livesay
  • 6,317
  • 3
  • 25
  • 31
  • 1
    i used which node, turned out its from /c/Program Files/Microsoft HPC Pack 2008 R2/Bin/node, not convinced if i should uninstall it I downloaded the binary and put it in the working folder, its working now, thanks! – FailedMathematician Sep 20 '15 at 11:58