title: After upgrading Node, 'Segmentation fault (core dumped)' error shows up. How can I fix it?
body: <p>I was trying to upgrade Node by following the instruction from <a href="https://tecadmin.net/upgrade-nodejs-via-npm/" rel="noreferrer">https://tecadmin.net/upgrade-nodejs-via-npm/</a>. I did <code>sudo npm cache clean -f</code>, <code>sudo npm install -g n</code>, and <code>sudo n stable</code>.
  After the above commands, I stupidly did <code>sudo ln -sf /usr/local/n/versions/node/11.8.0/bin/node /usr/bin/node</code>. After this command, I checked the <code>/usr/local/n/versions/node</code> folder. It had <code>10.15.3</code>, so I typed <code>sudo ln -sf /usr/local/n/versions/node/10.15.3/bin/node /usr/bin/node</code>.</p>
  
  <p>Right now, <code>node -v</code> gives me <code>10.15.3</code>. However, <code>npm -version</code> gives me <code>Segmentation fault (core dumped)</code>. Other commands like <code>npm update -g</code> also gives me the same error message. </p>
  
  <p>Other posts about the <code>Segmentation fault (core dumped)</code> error don't seem to be directly related to my problem. </p>
  
  <p>How can I fix this?</p>
  
  <p>I am using Ubuntu 19.04.</p>
  
  <p>Thank you.</p>