Error("Cannot find module '" + request + "'"): Clean install, no modules added

2.5k Views Asked by At

I've just installed Node (0.6.18) and IISNode (0.1.19.0) and ran through a simple example. If I've created a file called

"ls.js"

with the following content:

var fs = require('fs');
var files = fs.readdirSync('.');
for(fn in files){
    console.log(files[fn]);
}

then from the directory it's saved in run "node ls.js" which gives the following error:

C:\nodetest>node ls.js

module.js:337
    throw new Error("Cannot find module '" + request + "'");
          ^
Error: Cannot find module 'C:\nodetest\ls.js'
    at Function._resolveFilename (module.js:337:11)
    at Function._load (module.js:279:25)
    at Array.0 (module.js:484:10)
    at EventEmitter._tickCallback (node.js:190:38)

Any ideas on what is missing what what it's looking for?

Thanks

1

There are 1 best solutions below

0
On BEST ANSWER

It would appear that 'C:\nodetest\ls.js' is not the correct spot on the fs