1

I used command :node-dev script.js

{
    var connect = require('connect');
    var app = connect()
      .use(connect.static('public'))
      .use(function (req, res) {
        res.end("Couldn't find it.");
      })
      .listen(3000);
}

here is error screen shot

Harpreet Singh
  • 2,603
  • 19
  • 30
Subhajit Panja
  • 1,190
  • 1
  • 8
  • 20
  • 1
    this code works fine for me once I copy paste it into a .js file and have run npm install connect – Catalyst Jun 29 '14 at 06:58
  • Sounds for me like a version conflict of npm . Your code will probably work with an older version of connect. This post sums it up very well: https://stackoverflow.com/questions/24346161/nodejs-connect-cannot-find-static – Dr.Escher Aug 28 '17 at 06:42

0 Answers0