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! ! ! ! ! !
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.
This is the answer I saw at that time.
Don’t forget to adopt the solution.