public
Last active

Install Node.JS on Mac OS X or Linux

  • Download Gist
node_reinstall.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
NUMBER_OF_CPU_CORES=2
BASHRC=~/.bashrc # use .bash_profile on OS X
 
# Remove old Node.JS installation
rm ~/local/*/node* -rf
rm ~/.node_libraries -rf
sudo rm /usr/local/*/node* -rf
sudo rm /usr/*/node* -rf
 
 
# Install Node.JS
mkdir -p ~/local/{bin,lib,share}
mkdir -p ~/local/share/man
 
cd ~/
git clone http://github.com/ry/node.git
cd node
git checkout v0.8.18
./configure --prefix=~/local
make -j ${NUMBER_OF_CPU_CORES}
make install
 
 
# Put node in your path
echo 'PATH=~/local/bin/:${PATH}' >> ${BASHRC}
source ~/.bashrc

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.