title: Node.js EACCES error when listening on most ports
body: <p>I'm testing out an app (hopefully to run on heroku, but am having issues locally as well).  It's giving me an EACCES error when it runs http.Server.listen() - but it only occurs on some ports.</p>
  
  <p>So, locally I'm running:</p>
  
  <pre><code>joe@joebuntu:~$ node
  &gt; var h = require('http').createServer();
  &gt; h.listen(900);
  Error: EACCES, Permission denied
      at Server._doListen (net.js:1062:5)
      at net.js:1033:14
      at Object.lookup (dns.js:132:45)
      at Server.listen (net.js:1027:20)
      at [object Context]:1:3
      at Interface.&lt;anonymous&gt; (repl.js:150:22)
      at Interface.emit (events.js:42:17)
      at Interface._onLine (readline.js:132:10)
      at Interface._line (readline.js:387:8)
      at Interface._ttyWrite (readline.js:564:14)
  </code></pre>
  
  <p>I don't have anything running on port 900 (or any of the other 20 ports I've tried), so this should work.  The weird part is that it <strong>does</strong> work on some ports.  For instance, port 3000 works perfectly.</p>
  
  <p>What would cause this?  </p>
  
  <h2>Update 1:</h2>
  
  <p>I figured out that on my local computer, the EACCES error is coming because I have to run node as root in order to bind to those certain ports.  I don't know why this happens, but using sudo fixes it.  However, this doesn't explain how I would fix it on Heroku.  There is no way to run as root on Heroku, so how can I listen on port 80?</p>