How to resolve "Segmentation fault: 11" error when running nodejs?
<p>I am using Mac OS Yosemite. I use <code>npm install -g n</code> to install the <code>n</code> module to try to upgrade nodejs. Then
I run</p>

<pre><code>n stable
</code></pre>

<p>But I received an error during the upgrade and it quit unexpectedly.</p>

<p>Then when I type "node -v" I get an error:</p>

<pre><code>Segmentation fault: 11
</code></pre>

<p>In fact I get this error when I type <code>npm install</code> and <code>node</code> so literally I can't use node or npm anymore.</p>

<p>What does it mean? how can I get my node.js back? I tried to reinstall it using 
<code>brew install node</code> but after the install I still get the error.</p>