apt-get remove nodejs npm node
sudo apt-get purge nodejs npm node
sudo rm -rvf /usr/local/bin/npm /usr/local/share/man/man1/node* /usr/local/lib/dtrace/node.d ~/.npm ~/.node-gyp /opt/local/bin/node opt/local/include/node /opt/local/lib/node_modules
sudo rm -rfv /usr/local/lib/node*
sudo rm -rfv /usr/local/include/node*
sudo rm -rfv /usr/local/bin/node*
sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install python-software-properties python g++ make nodejs
sudo apt-get install npm
sudo npm cache clean
ORsudo npm cache vefify
sudo npm install -g n
sudo n latest
ln -sf /usr/local/n/versions/node/<version no from above step>/bin/node /usr/bin/node
after removing with the command "sudo rm -rf /usr/local/bin/node*" to reinstall nodejs, what command do you use