title: node.js+express+jade: style.css internal server error 500
body: <p>I have a problem with node.js+express+jade that I don't know how to resolve, I have already searched on google and stackoverflow with no solution, so I ask to you to help me please :)</p>
  
  <p>The problem is that all works except for style.css: </p>
  
  <pre><code>Failed to load resource: the server responded with a status of 500 (Internal 
   Server Error)
  </code></pre>
  
  <p>P.S: i have reinstalled latest versions of <em>node.js</em> and modules for security, without solution</p>
  
  <p>UPDATE:the error outs ONLY when I add this: <code>link(rel='stylesheet', href='style.css')</code> in the jade file</p>
  
  <p><strong>app.js</strong></p>
  
  <pre><code>var express = require("express"); 
  app = express(),
  routes = require('./routes');
  
  app.configure(function(){
      app.set('port', 8080);
      app.set('views', __dirname + '/views');
      app.set('view engine', 'jade');
      app.use(express.favicon());
      app.use(express.logger('dev'));
      app.use(express.urlencoded());
      app.use(express.methodOverride());
      app.use(app.router);
      app.use(express.static(__dirname + '/public'));
  });
  
  app.get("/", routes.index);
  
  app.listen(app.get("port"), function() {
      console.log("App listening on port " + app.get("port"));
  });
  </code></pre>
  
  <p><strong>routes/index.js</strong></p>
  
  <pre><code>exports.index = function(req, res) {
      res.render('index');
  };
  </code></pre>
  
  <p><strong>public/style.css</strong></p>
  
  <pre><code>body {
      font-size: 20px;
  }
  </code></pre>
  
  <p><strong>i have got this error:</strong></p>
  
  <pre><code>my_path_privacy\nodejs-test&gt;node app.js
      App listening on port 8080
      ←[90mGET / ←[32m200 ←[90m3674ms - 867b←[0m
      TypeError: Object #&lt;SendStream&gt; has no method 'on'
          at Object.staticMiddleware [as handle] (my_path_privacy\nodejs-test\node_modules\express\node_modules\connect\lib\middleware\static.js:89:8)
          at next (my_path_privacy\nodejs-test\node_modules\express\node_modules\connect\lib\proto.js:193:15)
          at pass (my_path_privacy\nodejs-test\node_modules\express\lib\router\index.js:110:24)
          at Router._dispatch (my_path_privacy\nodejs-test\node_modules\express\lib\router\index.js:173:4)
          at Object.router [as handle] (my_path_privacy\nodejs-test\node_modules\express\lib\router\index.js:33:10)
          at next (my_path_privacy\nodejs-test\node_modules\express\node_modules\connect\lib\proto.js:193:15)
          at Object.methodOverride [as handle] (my_path_privacy\nodejs-test\node_modules\express\node_modules\connect\lib\middleware\methodOverride.js:48:5)
          at next (my_path_privacy\nodejs-test\node_modules\express\node_modules\connect\lib\proto.js:193:15)
          at Object.urlencoded [as handle] (my_path_privacy\nodejs-test\node_modules\express\node_modules\connect\lib\middleware\urlencoded.js:41:37)
          at next (my_path_privacy\nodejs-test\node_modules\express\node_modules\connect\lib\proto.js:193:15)
      ←[90mGET /style.css ←[31m500 ←[90m52ms - 1.34kb←[0m
  </code></pre>
  
  <p><strong>package.json</strong></p>
  
  <pre><code>{
     "name": "app-test",
     "version": "0.0.1",
     "private": true,
     "scripts": {
         "start": "node app.js"
     },
     "dependencies": {
        "express": "3.4.7",
        "jade": "1.1.0"
     },
     "engines": {
        "node": "0.10.24",
        "npm": "1.3.21"
    }
  }
  </code></pre>
  
  <p><strong>index.jade</strong></p>
  
  <pre><code>doctype html
  html
    head
      title Hello world
      link(rel='stylesheet', href='style.css')
    body
      p Hello world
  </code></pre>