title: Using stylus middleware with express 4, SyntaxError
body: <p>Im trying to use nodejs express v4 with stylus, but its throwing SyntaxError. Please help, also you can find my server.js below;; </p>
  
  <p>Please note: Im first time creating MEANstack project, and dont be harsh on me :)</p>
  
  <p>Your environment has been set up for using Node.js 0.10.26 (x64) and npm.</p>
  
  <pre><code>Error: Most middleware (like logger) is no longer bundled with Express and must
  be installed separately. Please see https://github.com/senchalabs/connect#middle
  ware.
      at Function.Object.defineProperty.get (C:\Sites\meanProject\node_modules\exp
  ress\lib\express.js:89:13)
      at Object.&lt;anonymous&gt; (C:\Sites\meanProject\server.js:10:17)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
      at Function.Module.runMain (module.js:497:10)
      at startup (node.js:119:16)
      at node.js:902:3
  </code></pre>
  
  <p>server.js:</p>
  
  <pre><code>    var express = require('express');
  var stylus = require('stylus');
  var env = process.env.NODE_ENV = process.env.NODE_ENV || 'development';
  
  var app = express();
  
  //set view engine
  app.set('views', __dirname + '/server/views');
  app.set('view engine', 'jade');
  app.use(express.logger('dev'));
  app.use(express.bodyParser());
  
  //style middlware
  app.use(stylus.middleware({
    src: __dirname + '/public',
    dest: __dirname + '/public/css',
    compile: function compile(str, path){
       return stylus(str).set('filename', path).set('compress', true);
    }
  }));
  
  app.use(express.static(path.join(__dirname + '/public')));//all public req will be responded by public dir now.
  
  //load route
  app.get('*', function(req, res){
      res.render('index');
  });
  
  //start listening on server
  var port = 3000;
  app.listen(port);
  console.log('Server running at localhost:' + port);
  </code></pre>