Skip to content

Instantly share code, notes, and snippets.

@tonywang0122
Created October 25, 2011 08:48
Show Gist options
  • Save tonywang0122/1311901 to your computer and use it in GitHub Desktop.
Save tonywang0122/1311901 to your computer and use it in GitHub Desktop.
How to install nodejs and npm at user directory
1. Download nodejs source
cd ~
git clone https://github.com/joyent/node.git
2. switch branch, if new version exist, use the new version number
cd ~/node
git checkout v0.5.10
3. set install directory and build
./configure --prefix=/yourdirectory/node
make
make install
4. set path
echo 'export NODE_PATH=/yourdirectory/node:/yourdirectory/lib/node_modules' >> ~/.bash_profile
echo 'export PATH=$PATH:/yourdirectory/node/bin' >> ~/.bash_profile
. ~/.bash_profile
5. download npm source
cd ~
git clone https://github.com/isaacs/npm.git
6. build npm
cd ~/npm
.configure
make
make install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment