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's a pretty idiomatic way for polyglot/github-using developers to setup language runtime/library environments under Linux: distro packages for the runtime, 3rd-party libraries in per-user environment (see virtualenv, RVM - RVM will also build Ruby for you if you want). If necessary I will build node locally but it's a PITA since Node is becoming an incidental development requirement for lots of projects.
- Instructions for installing node+npm to home directory
- Another method for installing node+npm to home
The second link seems like it might work with distribution nodejs packages, but it seems pretty sketchy.
Update this paste sums up the second link above, but doesn't work for me (it seems like npm ignores ~/.npmrc, at least during install).
Because python does already a great job
virtualenv
, I usenodeenv
. Compared tonvm
, you can create multiple environments for the same node version (e.g. two environments for node0.10
but with different sets of packages).The readme is pretty good: https://github.com/ekalinin/nodeenv