Created
October 25, 2011 08:48
-
-
Save tonywang0122/1311901 to your computer and use it in GitHub Desktop.
How to install nodejs and npm at user directory
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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