Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
npm + node install
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/local
make install
curl | sh
# this way is really handy if you want to test things
# in different versions of node and use stable release
# versions of things.
# make a folder where you want to keep this stuff.
mkdir my-happy-node-stuff
cd my-happy-node-stuff
sudo ln -s $PWD/ /usr/local/bin/nave
# now you can forget about that folder.
# you never have to go back in there.
# to use a version of node in a virtual environment
nave use 0.2.3
# to install npm in that virtualenv
curl | sh
# do stuff...
npm install whatever etc
# return to non-nave-land
# use a different version of node..
nave use 0.2.1
# etc...
echo 'export PATH=$HOME/.local/bin:$PATH' >> ~/.bashrc
echo 'export npm_config_userconfig=$HOME/.config/npmrc' >> ~/.bashrc
. ~/.bashrc
mkdir ~/.local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl | tar xz --strip-components=1
./configure --prefix=~/.local
make install
curl | sh
# install node wherever...
cat <<NPMRC >>$HOME/.npmrc
root = ~/.node_libraries
manroot = ~/local/share/man
binroot = ~/bin
curl | sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment