Why do I always report mistakes according to the examples in the book, a simple statement like connect.static is not a function

  node.js, question

图片描述
图片描述
图片描述

var connect = require('connect');
 connect.createServer(
 connect.static('../angularjs')
 ).listen(5000);
 
 
 
 With such a code, the console has always been typeeeror: connect.
 Report an error, then I output connect, no problem, but the createServer method will report an error, once using nodejs, according to the book, how can it never work?
 
 To be clear, I have already installed the NPM Connect module!  !  !  !  !  !

pro angularJS?
When I was reading this book, I also met it. I was right upstairs. The higher version of NodeJs does not support connect, so I need to join it.


clipboard.png
This is the answer I saw at that time.
http://stackoverflow.com/questions/24346161/nodejs-connect-cannot-find-static

Don’t forget to adopt the solution.