node.js simply does not run

Posted by user309641 on Stack Overflow See other posts from Stack Overflow or by user309641
Published on 2012-03-20T23:26:22Z Indexed on 2012/03/20 23:29 UTC
Read the original article Hit count: 162

Filed under:

I installed and ran node.js just fine on my mac, but even if I do this on windows

chdir c:\testfolder
node example.js

then I get this error:

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
Error: Cannot find module 'c:\testfolder\example.js'

at Function._resolveFilename <module.js:322:11>
at Function._load <module.js:299:25>
at Array.0 <module.js:499:10>
at EventEmitter._tickCallback <node.js:192:40>

I'm only even trying to run the example code on the nodejs website:

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/');

© Stack Overflow or respective owner

Related posts about node.js