title: Installing MEAN Stack: npm -v module.js: 338 throw err; Error: Cannot find module './cache/caching-client.js'
body: <p>I think I have installed node.js before but never used homebrew to do it.  Today I tried to do a walkthrough of an application but got stuck at the very beginning.  I am fairly new to programming so I am utterly confused as to why I can't get this to work.  </p>
  
  <p>I have tried a lot of things but can't seem to find the answer.  </p>
  
  <p>These are the commands I run in order to install the MEAN stack:</p>
  
  <ol>
  <li><code>ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"</code>
  (succesful no errors)</li>
  <li><code>brew install node</code>
  (succesfull no errors)</li>
  <li>I check if node has installed properly by typing:
  <code>node -v</code>
  <code>v0.12.4</code></li>
  <li>I then check if npm is installed properly by typing:
  <code>npm -v</code></li>
  </ol>
  
  <p>Here is the error message:</p>
  
  <pre><code>module.js:338
      throw err;
            ^
  Error: Cannot find module './cache/caching-client.js'
      at Function.Module._resolveFilename (module.js:336:15)
      at Function.Module._load (module.js:278:25)
      at Module.require (module.js:365:17)
      at require (module.js:384:17)
      at /usr/local/lib/node_modules/npm/lib/npm.js:22:24
      at Object.&lt;anonymous&gt; (/usr/local/lib/node_modules/npm/lib/npm.js:466:3)
      at Module._compile (module.js:460:26)
      at Object.Module._extensions..js (module.js:478:10)
      at Module.load (module.js:355:32)
      at Function.Module._load (module.js:310:12)
  </code></pre>
  
  <p>I have installed node in a different way other than using Homebrew and maybe that is messing things up.  Please let me know your thoughts. </p>
  
  <p>What I have tried to do so far is uninstall node and reinstall it using this process:
  <a href="https://gist.github.com/DanHerbert/9520689" rel="nofollow">https://gist.github.com/DanHerbert/9520689</a></p>