Upgrade Node.js to the latest version on Mac OS (without brew)

Here’s how I successfully upgraded a latest version without any other requirements like brew etc

Step 1:

sudo npm cache clean -f

Step 2:

sudo npm install -g n

Step 3:

sudo n stable 

Note step 3: stable can be exchanged for latestlts (long term support) or any specific version number such as X.XX.XX.

If the version number doesn’t show up after typing¬†

node -v

you might reboot.