title: node.js: cannot find module 'request'
body: <p>I installed <a href="https://github.com/mikeal/request" rel="noreferrer">request module</a>, and getting the error:</p>
  <pre><code>module.js:340
      throw err;
            ^
  Error: Cannot find module 'request'
  </code></pre>
  <p>i've read all the posts about this error, and understand that this is because module requests is not globally found, but i've already tried the 2 suggestions</p>
  <blockquote>
  <p>npm install request -g</p>
  </blockquote>
  <p>should this install it in /usr/loca/bin ? because i don't see it there.</p>
  <p>and</p>
  <blockquote>
  <p>sudo npm link</p>
  <p>/usr/local/lib/node_modules/request -&gt; /Users/soulsonic/dev/sandbox/node_test/request</p>
  </blockquote>
  <p>i restarted terminal after each command, but keep getting the cannot find module  error.</p>
  <p><strong>update</strong></p>
  <p>there must have been some sort of conflict in my initial directory, because &quot;npm install request&quot; was not adding &quot;request&quot; under node_modules (there 10 others in there) ..
  after switching to a new directory it just worked.</p>
  <p>if i run it with -g switch, i do see it bing installed to /usr/local/lib/node_modules/request.</p>
  <p>it seems that i just need to update my profile so that above path is automatically added.</p>