Skip to content

Instantly share code, notes, and snippets.

@guybrush
Created September 11, 2010 05:36
Show Gist options
  • Save guybrush/574872 to your computer and use it in GitHub Desktop.
Save guybrush/574872 to your computer and use it in GitHub Desktop.
install multiple nodejs versions, use same npm packages
#
# node ---------------> ~/.nvm/<node-version>/bin/node
# node-libraries -----> ~/.node_libraries
# node-binaries ------> ~/.node_binaries
#
aptitude install g++ curl libssl-dev apache2-utils make
git clone git://github.com/creationix/nvm.git ~/.nvm
vi ~/.bashrc
export PATH=$PATH:~/.node_binaries
NVM_DIR=$HOME/.nvm
. $NVM_DIR/nvm.sh
nvm use
nvm install v0.2.5
nvm use v0.2.5
mkdir ~/.node_libraries
mkdir ~/.node_binaries
git clone http://github.com/isaacs/npm.git tmpnpm
tmpnpm/cli.js install npm \
--root ~/.node_libraries \
--binroot ~/.node_binaries
rm -rf tmpnpm
npm config set root ~/.node_libraries
npm config set binroot ~/.node_binaries
nvm help
npm help
npm install connect spark express jade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment