You may use nvm.
- Check what is the latest version at http://nodejs.org/ (e.g. v0.10.26)
- Run
nvm install v0.10.26
Done.
You can choose which version to run:
nvm ls
list the available versions and tells you which version you are using now.
nvm use VERSION
change the current node to the requested version.
nvm alias default VERSION
set the default version. The next time you source nvm.sh, this will be the version loaded (note that it doesn't change the version in use right now, run nvm use
for that).