title: How to upgrade node to specific version in macOS Mojave, and update the active path for node?
body: <p>I want to upgrade node to 12.10.0 and npm to 6.11.3, currently I am working on macOS Mojave version 10.14.5</p>
  
  <p>I am using these commands to upgrade the node version to 12.10.0::</p>
  
  <ol>
  <li><code>sudo npm cache clean -f</code> (force) clear you npm cache</li>
  <li><code>sudo npm install -g n</code> install n (this might take a while)</li>
  <li><code>sudo n 12.10.0</code> upgrade to the specific version</li>
  </ol>
  
  <p>After running the last command it gives me an output like::</p>
  
  <pre><code>installing : node-v12.10.0
         mkdir : /usr/local/n/versions/node/12.10.0
         fetch : https://nodejs.org/dist/v12.10.0/node-v12.10.0-darwin-x64.tar.gz
     installed : v12.10.0 to /usr/local/bin/node
        active : v10.16.3 at /usr/local/opt/node@10/bin/node
  </code></pre>
  
  <p>When I am checking for node version <code>node -v</code> it still shows me old version <code>10.16.3</code> </p>
  
  <p>I have tried to add node path, but still, it gives me the same output. 
  I have used command <code>sudo nano /etc/path</code> and then added <code>/usr/local/bin/node</code> path to it. </p>
  
  <p>Please suggest me how can I upgrade node to 12.10.0 and npm to 6.11.3 version?</p>