Skip to content

Instantly share code, notes, and snippets.

@creeperyang
Last active August 29, 2015 14:11
Show Gist options
  • Save creeperyang/5065daa4d89b771db0d2 to your computer and use it in GitHub Desktop.
Save creeperyang/5065daa4d89b771db0d2 to your computer and use it in GitHub Desktop.
# See <https://gist.github.com/isaacs/579814>
# 1
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
# 2
# this way is best if you want to stay up to date
# or submit patches to node or npm
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
# could also fork, and then clone your own fork instead of the official one
git clone git://github.com/joyent/node.git
cd node
./configure --prefix=~/local
make install
cd ..
git clone git://github.com/isaacs/npm.git
cd npm
make install # or `make link` for bleeding edge
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment