title: What is the difference between "npm update -g", "npm upgrade -g", "npm install -g npm", and "n stable"?
body: <p>My npm seems out of date, so it seems I could use four different ways to update it:</p>
  <pre><code>sudo npm update -g          # =&gt; npm 3.8.6
  sudo npm upgrade -g         # =&gt; npm 3.8.7
  sudo npm install -g npm
  sudo npm cache clean -f &amp;&amp; sudo npm install -g n &amp;&amp; sudo n stable
  </code></pre>
  <p>Some of the methods above installed npm 3.8.6, some installed 3.8.7, and the last one by <code>n</code> installed 3.8.3.</p>
  <p>What are the differences between these methods and is there a standard way / official way to do it?</p>
  <p>(The 3.8.6 and 3.8.7 difference was on my MacBook 12 inch Retina with <a href="https://en.wikipedia.org/wiki/OS_X_El_Capitan" rel="noreferrer">Mac OS X v10.11</a> (El Capitan). It wasn't so on my MacBook Pro with <a href="https://en.wikipedia.org/wiki/OS_X_Mavericks" rel="noreferrer">Mac OS X v10.9</a> (Mavericks).)</p>