"TypeError: res.sendStatus is not a function" why I am getting this error after sometime?
<p>I have installed 'express' using npm, I've successfully got port number listening on 3000. but after a while i got the following error,</p>

<blockquote>
  <p>TypeError: res.sendStatus is not a function</p>
</blockquote>

<p>As we know, <code>res.sendStatus(404)</code> is related to express.but express is clearly located.</p>

<p>Here is source code in app.js</p>

<pre><code>var express = require('express'),
app = express();

app.get('/', function(req, res){
  res.send('Hello Worlds');
});

app.use(function(req, res){
  res.sendStatus(404); 
});

var server = app.listen(3000, function() {
  var port = server.address().port;
 console.log('Express server listening on port %s', port);
});
</code></pre>

<p>Here is my full cmd output,</p>

<pre><code>&gt; $ node app.js
Express server listening on port 3000
TypeError: res.sendStatus is not a function
    at Object.handle (I:\mongoUniversity\hello_world_templates\app.js:14:9)
    at next (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\proto.js:174:15)
    at pass (I:\mongoUniversity\hello_world_templates\node_modules\express\lib\router\index.js:110:24)
    at Router._dispatch (I:\mongoUniversity\hello_world_templates\node_modules\express\lib\router\index.js:173:5)
    at Object.router (I:\mongoUniversity\hello_world_templates\node_modules\express\lib\router\index.js:33:10)
    at next (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\proto.js:174:15)
    at Object.expressInit [as handle] (I:\mongoUniversity\hello_world_templates\node_modules\express\lib\middleware.js:30:5)
    at next (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\proto.js:174:15)
    at Object.query [as handle] (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\middleware\query.js:43:5)
    at next (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\proto.js:174:15)
    at Function.app.handle (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\proto.js:182:3)
    at Server.app (I:\mongoUniversity\hello_world_templates\node_modules\connect\lib\connect.js:67:37)
    at emitTwo (events.js:87:13)
    at Server.emit (events.js:172:7)
    at HTTPParser.parserOnIncoming [as onIncoming] (_http_server.js:525:12)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
</code></pre>

<p>I have checked similar questions, where they told to check if 'express' was installed or not, but i have installed it correctly. Then what am i doing wrong?</p>