title: Nodejs app crashing frequently
body: <p>I am using <code>gulp-nodemon</code> to restart the nodejs server frequently on changes in <code>server.js</code> file. </p>
  
  <p>Here is the excerpt code from <code>server.js</code>:</p>
  
  <pre><code>var express = require('express');
  var app = express();
  var router = express.Router();
  var path = require('path');
  
  app.use(express.static(path.join(__dirname, 'site'))); //  "public" off of current is root
  
  app.listen(9090, function () {
    console.log('Example app listening on port 9090!');
  });
  
  app.get('/getProducts', function(req, res){
    console.log(req.body.query);
  
    res.send({
      hey: "hello"
    });
  });
  </code></pre>
  
  <p>I am getting the following error frequently:</p>
  
  <p><a href="https://i.stack.imgur.com/dPyzR.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/dPyzR.png" alt="enter image description here"></a></p>
  
  <p>I even tried changing the ports (<code>netstat -a</code>). Sometimes the nodejs server works and sometimes it doesn't.</p>
  
  <p>PS: I am on Windows 8</p>