title: Express + socket.io: socket.io client script is 404
body: <p>This is driving me crazy... while I have a working version of Express + Socket.io, I can't seem to reproduce it with out-of-the-box NPM installs in a new project folder. Can anyone point out what I'm missing...? Here's my process:</p>
  
  <p>I create a <code>node_modules</code> folder in my project directory (<code>pwd</code>), then do:</p>
  
  <pre><code>npm install express
  npm install socket.io
  </code></pre>
  
  <p>Running those two commands puts the packages in my project's <code>node_modules</code> folder as expected. Now I set up my server with the following:</p>
  
  <pre><code>var express = require('express'),
      server = express.createServer().use( express.static(__dirname+'./public') ).listen( 8080 ),
      io = require('socket.io').listen(server);
  </code></pre>
  
  <p>My <code>public</code> folder contains static assets for my application. My public index HTML page includes a script tag for:</p>
  
  <pre><code>&lt;script src="/socket.io/socket.io.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>Finally, I run my server script and go to the application in a web browser. My static public files are all served properly, however I get a 404 for <code>/socket.io/socket.io.js</code>. Now, I can swap in an <code>express</code> package from another old project and have this whole system work. Somehow that package instance is configured differently, but I can't figure out how to reproduce that. The Express website mentions something about installing dependencies, although running <code>npm install -d</code> doesn't seem to help (is there a specific <code>pwd</code> that I need to be in while running <code>npm install -d</code>?). I figure I must be missing something important about configuring a new Express instance after installing it with NPM.</p>
  
  <p>Thanks for any and all insight!</p>