I\'d like to use the distribution Node.js packages (or the chris-lea ppa for more recent releases) but install NPM to my home directory.
This may seem picky, but it
Because python does already a great job virtualenv, I use nodeenv. Compared to nvm, you can create multiple environments for the same node version (e.g. two environments for node 0.10 but with different sets of packages).
ENVNAME=dev1
# create an environment
python -m virtualenv ${ENVNAME}
# switch to the newly created env
source ${ENVNAME}/bin/activate
# install nodeenv
pip install nodeenv
# install system's node into virtualenv
nodeenv --node=system --python-virtualenv
The readme is pretty good: https://github.com/ekalinin/nodeenv