Any help?

19 views
Skip to first unread message

Chris

unread,
Aug 7, 2012, 2:49:01 PM8/7/12
to peep...@googlegroups.com
The first exercise works fine for me. The second exercise completely screws everything up. I'm having trouble finding the error, any help would be greatly appreciated.

Code:

require.paths.unshift(__dirname + "/vendor");

var http = require('http'),
sys = require('sys'),
nodeStatic = require('node-static/lib/node-static');

var server = http.createServer(function(request, response) {
var file = new nodeStatic.Server('./public', {
cache: false
});
request.addListener('end', function() {
file.serve(request, response);
});
});
server.listen(8000);

Error message:

Error: require.paths is removed. Use node_modules folders, or the NODE_PATH environment variable instead.
at Function.Module._compile.Object.defineProperty.get (module.js:386:11)
at Object.<anonymous> (/Users/user/livestats/server.js:1:70)
at Module._compile (module.js:449:26)
at Object.Module._extensions..js (module.js:467:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.runMain (module.js:492:10)
at process.startup.processNextTick.process._tickCallback (node.js:244:9)

Reply all
Reply to author
Forward
0 new messages