Created
September 30, 2013 11:09
-
-
Save vnykmshr/6762290 to your computer and use it in GitHub Desktop.
Installs node.js from source. Also installs missing libraries needed to run node.js. Update node version to latest stable release.
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
#!/bin/sh | |
## Install pre-requisites | |
sudo apt-get install -y git-core build-essential openssl libssl-dev pkg-config | |
## Ensure python <3 is available | |
ret=`python -c 'import sys; print("%i" % (sys.hexversion<0x03000000))'` | |
if [ $ret -eq 0 ]; then | |
echo "we require python version <3" | |
mkdir /tmp/bin; ln -s /usr/bin/python2.7 /tmp/bin/python; | |
export PATH = /tmp/bin:$PATH | |
else | |
echo "python version is <3" | |
fi | |
mkdir ~/workspace | |
cd ~/workspace && git clone https://github.com/joyent/node.git | |
cd node && git checkout v0.10.3 # check nodejs.org for latest stable release | |
./configure | |
make -j2 && sudo make install | |
# Print node version | |
node --version && npm --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment