Since nodejs is still young and backed by an active community, developers face a challenge to manage newer versions of node on regular basis. nvm is your friend. Using nvm you can install multiple versions of node and manage each version's packages separately.
To install nvm run,
>curl https://raw.github.com/creationix/nvm/master/install.sh | sh
To install a specific version of node use nvm install command. For example following command will install version node version 0.10.1
>nvm install v0.10.1
To set a default node version
>nvm alias default v0.10.1
To change system to start using a specific version of node
>nvm use 0.10.1
To make sure that nvm is initialized in your shell add following command in your shell initialization script. For example I use bash shell so I will add this to ~/.bashrc or ~/.bash_profile
[[ -s /Users/user/.nvm/nvm.sh ]] && . /Users/user/.nvm/nvm.sh # This loads NVM
To install nvm run,
>curl https://raw.github.com/creationix/nvm/master/install.sh | sh
To install a specific version of node use nvm install command. For example following command will install version node version 0.10.1
>nvm install v0.10.1
To set a default node version
>nvm alias default v0.10.1
To change system to start using a specific version of node
>nvm use 0.10.1
To make sure that nvm is initialized in your shell add following command in your shell initialization script. For example I use bash shell so I will add this to ~/.bashrc or ~/.bash_profile
[[ -s /Users/user/.nvm/nvm.sh ]] && . /Users/user/.nvm/nvm.sh # This loads NVM