title: Including other libraries / files / plugins with nodejs and NPM
body: <p>I'm using OSX 10.5 and playing around with Nodejs. I've managed to install npm and used it to install a couple of plugins. Well at least the installation says it has worked fine but when I try and load them in I get an error</p>
  
  <pre><code>$npm install htmlparser
  </code></pre>
  
  <p>Installs ok, then I create a file called test with </p>
  
  <pre><code>var htmlparser = require("node-htmlparser");
  </code></pre>
  
  <p>and run</p>
  
  <pre><code>$node test.js
  </code></pre>
  
  <p>I get </p>
  
  <blockquote>
    <pre class="lang-none prettyprint-override"><code>var htmlparser = require("node-htmlparser");
  node.js:275
          throw new Error("Cannot find module '" + request + "'");
  </code></pre>
  </blockquote>
  
  <p>I have this in my <code>.bash_profile</code> file:</p>
  
  <pre><code>export NODE_PATH="/usr/local/lib/node"
  </code></pre>
  
  <p>If I clone the GIT repos at <a href="http://github.com/tautologistics/node-htmlparser" rel="nofollow noreferrer">this page</a> and move the file <code>lib/node-htmlparser.js</code> to <code>~/.node_libraries</code> then it works fine. </p>
  
  <p>What is the point of using npm to install anything if I have to move the lib file like this? Am I missing something ?   </p>