check latest nvm version from this
https://github.com/creationix/nvm
install latest version
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
install latest nodejs
nvm install 0.12
nvm use 0.12
node -v
on mac, put this at the end of file ~/.bash_profile or ~/.profile
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
if you want to remove nodejs
sudo apt-get remove nodejs
default node version
nvm alias default {version}
#example
nvm alias default v0.10