title: Node.js + Express - Can't connect. ERR_CONNECTION_REFUSED
body: <p>I followed this basic example:</p>
  
  <p><a href="http://shapeshed.com/creating-a-basic-site-with-node-and-express/" rel="noreferrer">http://shapeshed.com/creating-a-basic-site-with-node-and-express/</a></p>
  
  <p>Files were generated...they're all there. I ran it all step-by-step. No matter which browser I use, I get "Unable to connect" (Firefox) and "This webpage is not available ... ERR_CONNECTION_REFUSED" (Chrome) - it's just not working. I checked the generated bin/www file and it seems to indicate port 3000. However, I got <em>no</em> output when I ran "node app.js" after generating the site. Upon looking at that file, I noticed it pointed to the wrong path for Node on my system, so I changed it to the correct one:</p>
  
  <pre><code>#!/usr/local/bin/ node
  
  /**
   * Module dependencies.
   */
  
  var app = require('../app');
  var debug = require('debug')('rwc:server');
  var http = require('http');
  
  /**
   * Get port from environment and store in Express.
   */
  
  var port = parseInt(process.env.PORT, 10) || 3000;
  app.set('port', port);
  
  /**
   * Create HTTP server.
   */
  
  var server = http.createServer(app);
  
  /**
   * Listen on provided port, on all network interfaces.
   */
  
  server.listen(port);
  server.on('error', onError);
  server.on('listening', onListening);
  
  /**
   * Event listener for HTTP server "error" event.
   */
  
  function onError(error) {
    if (error.syscall !== 'listen') {
      throw error;
    }
  
    // handle specific listen errors with friendly messages
    switch (error.code) {
      case 'EACCES':
        console.error('Port ' + port + ' requires elevated privileges');
        process.exit(1);
        break;
      case 'EADDRINUSE':
        console.error('Port ' + port + ' is already in use');
        process.exit(1);
        break;
      default:
        throw error;
    }
  }
  
  /**
   * Event listener for HTTP server "listening" event.
   */
  
  function onListening() {
    debug('Listening on port ' + server.address().port);
  }
  </code></pre>
  
  <p>No dice. Nothing changed. No output when running "node app.js" and can't pull it up. I know node is there and correctly installed since I've already run a bunch of example code and played with it a bit.</p>
  
  <p>On OS X Yosemite but my firewall is turned off.</p>
  
  <p>What's going on? Surprisingly little info found when search on this too - makes me hesitant to build anything serious with Node.</p>