简体   繁体   中英

Installing node.js for angular - connect.static and karma

I'm trying to install a simple node webserver following the example in Pro AngularJS from apress.

I've installed node.js and the connect and karma modules.

I do get a warning when I installed karma via: "npm install -g karma" that says "optional dep failed, continuing" but then seems to install correctly.

I created a server.js based on the example:

var connect = require('connect');

connect.createServer(
    connect.static("../angularjs")
).listen(5000);

when I run it I get TypeError:Undefined is not a function pointing to connect.static.

Apparently in the latest build of connect the static middleware has been moved to it's own package.

nodejs connect cannot find static

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM