When I ran node to set up a web server, I got the following error:
C:\Users\Me\server.js:4
connect.static("../angularjs")
^
TypeError: undefined is not a function
at Object.(anonymous) (C:\Users\Me\server.js:4:19)
at Module._compile (module.js:460:26)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129.160
at node.js:814:3
This is the contents of server.js
var connect = require('connect');
connect.createServer(
connect.static("../angularjs")
).listen(5000);
I'm following instructions in Pro AngularJS book from Apress by Adam Freeman.
I downloaded the listings from their website.
I'm running Windows 7 Pro
I tried the solution suggested to install serve-static module and now when I run the revised server.js the command window just hangs.
The new server.js is:
var connect = require('connect'),
serveStatic = require('serve-static');
var app = connect();
app.use(serveStatic("../angularjs"));
app.listen(5000);