If we want to upgrade NodeJS to latest version using NPM.
we have to run following commands in Terminal.
sudo npm cache clean -f
we have to run following commands in Terminal.
sudo npm cache clean -f
sudo npm install -g n
sudo n stable