title: node js Exit status 8, error code 0 running on mac
body: <p>Following <a href="http://cwbuecheler.com/web/tutorials/2013/node-express-mongo/" rel="nofollow">this</a> guide i have hit an error but not sure what the issue is.</p>
  
  <p>I managed to get to the end of step 2 no problem, I restarted the server <code>npm start</code>. Then I had a bit of a poke around with the jade files, ran the start again and it moaned whilst putting very little in the logs. <strong>Before posting on here I deleted the entire folder and started again, but now the npm server won't start with even the basic files created by express.</strong></p>
  
  <p>When I run:  <code>npm install -g express</code>  just as the local user i get errors telling me to run as root. So express is installed as root, however <code>npm install -g express-generator</code> ran fine as local user.</p>
  
  <p>So with express and express generator installed I can now create an express project (logged in as local user, not root, project name... noders):</p>
  
  <pre><code>express noders
  </code></pre>
  
  <p>Now npm install to get all the dependencies:</p>
  
  <pre><code>npm install
  </code></pre>
  
  <p>So in theory I should now be able to start the node js server...</p>
  
  <pre><code>npm start
  </code></pre>
  
  <p>But the result is:</p>
  
  <pre><code>Janines-MacBook-Pro:noders janinenitz$ npm start
  
  &gt; noders@0.0.0 start /Users/janinenitz/node/noders
  &gt; node ./bin/www
  
  
  events.js:72
          throw er; // Unhandled 'error' event
                ^
  Error: listen EADDRINUSE
      at errnoException (net.js:905:11)
      at Server._listen2 (net.js:1043:14)
      at listen (net.js:1065:10)
      at Server.listen (net.js:1139:5)
      at Function.app.listen (/Users/janinenitz/node/noders/node_modules/express/lib/application.js:556:24)
      at Object.&lt;anonymous&gt; (/Users/janinenitz/node/noders/bin/www:7:18)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
  
  npm ERR! noders@0.0.0 start: `node ./bin/www`
  npm ERR! Exit status 8
  npm ERR! 
  npm ERR! Failed at the noders@0.0.0 start script.
  npm ERR! This is most likely a problem with the noders package,
  npm ERR! not with npm itself.
  npm ERR! Tell the author that this fails on your system:
  npm ERR!     node ./bin/www
  npm ERR! You can get their info via:
  npm ERR!     npm owner ls noders
  npm ERR! There is likely additional logging output above.
  npm ERR! System Darwin 14.0.0
  npm ERR! command "node" "/usr/local/bin/npm" "start"
  npm ERR! cwd /Users/janinenitz/node/noders
  npm ERR! node -v v0.10.35
  npm ERR! npm -v 1.4.28
  npm ERR! code ELIFECYCLE
  npm ERR! 
  npm ERR! Additional logging details can be found in:
  npm ERR!     /Users/janinenitz/node/noders/npm-debug.log
  npm ERR! not ok code 0
  </code></pre>
  
  <p>And the log file:</p>
  
  <pre><code>0 info it worked if it ends with ok
  1 verbose cli [ 'node', '/usr/local/bin/npm', 'start' ]
  2 info using npm@1.4.28
  3 info using node@v0.10.35
  4 verbose run-script [ 'prestart', 'start', 'poststart' ]
  5 info prestart noders@0.0.0
  6 info start noders@0.0.0
  7 verbose unsafe-perm in lifecycle true
  8 info noders@0.0.0 Failed to exec start script
  9 error noders@0.0.0 start: `node ./bin/www`
  9 error Exit status 8
  10 error Failed at the noders@0.0.0 start script.
  10 error This is most likely a problem with the noders package,
  10 error not with npm itself.
  10 error Tell the author that this fails on your system:
  10 error     node ./bin/www
  10 error You can get their info via:
  10 error     npm owner ls noders
  10 error There is likely additional logging output above.
  11 error System Darwin 14.0.0
  12 error command "node" "/usr/local/bin/npm" "start"
  13 error cwd /Users/janinenitz/node/noders
  14 error node -v v0.10.35
  15 error npm -v 1.4.28
  16 error code ELIFECYCLE
  17 verbose exit [ 1, true ]
  </code></pre>
  
  <p>After reading a few other posts I stopped the node server <code>npm stop</code> before starting again hoping for no collisions in port numbers but i get the same.</p>
  
  <p>When I run as root I get the exact same result.</p>
  
  <p>Does anyone have any ideas? Does each site you install with node hog a port number and require removing or something?</p>
  
  <hr>
  
  <p>When running <code>lsof -i</code> this is the result (after closing web browsers): </p>
  
  <pre><code>COMMAND   PID       USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
  UserEvent 201 janinenitz    4u  IPv4 0x45000000008e2c77      0t0  UDP *:*
  SystemUIS 209 janinenitz   23u  IPv4 0x45000000478e706f      0t0  UDP *:53884
  SystemUIS 209 janinenitz   25u  IPv4 0x00000000478e6e17      0t0  UDP *:*
  sharingd  221 janinenitz   12u  IPv4 0x450000004711d70f      0t0  UDP *:*
  SpotifyWe 274 janinenitz    6u  IPv4 0x4500000048000000      0t0  TCP localhost:4370 (LISTEN)
  SpotifyWe 274 janinenitz    7u  IPv4 0x456d000048b19947      0t0  TCP localhost:4380 (LISTEN)
  WiFiAgent 278 janinenitz   16u  IPv4 0x4560000047000000      0t0  UDP *:*
  </code></pre>
  
  <p>With no sign of anything listening on port 3000 (this is what i was previously getting a defualt page from with the tutorial mentioned above) I restart npm and still get the same result as above:</p>
  
  <pre><code>events.js:72
          throw er; // Unhandled 'error' event
                ^
  Error: listen EADDRINUSE
      at errnoException (net.js:905:11)
      at Server._listen2 (net.js:1043:14)
      at listen (net.js:1065:10)
      at Server.listen (net.js:1139:5)
      at Function.app.listen (/Users/janinenitz/node/noders/node_modules/express/lib/application.js:556:24)
      at Object.&lt;anonymous&gt; (/Users/janinenitz/node/noders/bin/www:7:18)
      at Module._compile (module.js:456:26)
      at Object.Module._extensions..js (module.js:474:10)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:312:12)
  ... etc etc
  </code></pre>
  
  <p>I also tried telling the app.js to listen to a random port number:  <code>app.listen(31001);</code>  but still no joy :S</p>
  
  <p>Is there a chance that the previous app I built and installed using <code>npm install</code> is now somehow in conflict with this one? Is there an official way of "uninstalling" a nodeJs app?</p>
  
  <p>Cheers,
  J</p>