The node binary module "n" is able to upgrade the nodejs version. Follow the below step:
1. Check the current node version.
node -v
2. Clean the npm cache.
sudo npm cache clean -f
3. Install the "n“ module.
sudo npm install -g n
4. Use "n" module to install the specific version nodejs.
sudo n stable / sudo n v0.12.2
The idea is from internet, put it down for future reference.