title: heroku app crash when listening on process.env.PORT
body: <p>When i deploy this on heroku :</p>
  
  <p>app.js</p>
  
  <pre><code>var port = process.env.PORT || 8080;
  
  app.listen(port, function(){
      console.log("Listening on port : " + port);
  });
  </code></pre>
  
  <p>I get the error logs :</p>
  
  <pre><code>2014-11-08T18:05:34.300115+00:00 app[web.1]: events.js:72
  2014-11-08T18:05:34.300402+00:00 app[web.1]:         throw er; // Unhandled 'error' event
  2014-11-08T18:05:34.300404+00:00 app[web.1]:               ^
  2014-11-08T18:05:34.303599+00:00 app[web.1]: Error: listen EADDRINUSE
  2014-11-08T18:05:34.303605+00:00 app[web.1]:     at errnoException (net.js:904:11)
  2014-11-08T18:05:34.303607+00:00 app[web.1]:     at Server._listen2 (net.js:1042:14)
  2014-11-08T18:05:34.303608+00:00 app[web.1]:     at listen (net.js:1064:10)
  2014-11-08T18:05:34.303610+00:00 app[web.1]:     at Server.listen (net.js:1138:5)
  2014-11-08T18:05:34.303628+00:00 app[web.1]:     at Function.app.listen (/app/node_modules/express/lib/application.js:556:24)
  2014-11-08T18:05:34.303629+00:00 app[web.1]:     at Object.&lt;anonymous&gt; (/app/bin/www:7:18)
  2014-11-08T18:05:34.303630+00:00 app[web.1]:     at Module._compile (module.js:456:26)
  2014-11-08T18:05:34.303632+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:474:10)
  2014-11-08T18:05:34.303633+00:00 app[web.1]:     at Module.load (module.js:356:32)
  2014-11-08T18:05:34.303635+00:00 app[web.1]:     at Function.Module._load (module.js:312:12)
  </code></pre>
  
  <p>but when i listen directly on port 8080 it work, and i cant understand why :</p>
  
  <pre><code>var port = 8080;
      app.listen(port, function(){
          console.log("Listening on port : " + port); //it work
      });
  </code></pre>
  
  <p>I have just started using nodejs and I don't really understand why it crashes.</p>
  
  <p>Could someone either explain the cause of this or how to "debug" this?</p>
  
  <p>Thanks !</p>