Skip to content

Instantly share code, notes, and snippets.

@EdsonAlcala
Created May 14, 2016 10:46
Show Gist options
  • Select an option

  • Save EdsonAlcala/73785cc1166c9f6d5fe37aa798cda362 to your computer and use it in GitHub Desktop.

Select an option

Save EdsonAlcala/73785cc1166c9f6d5fe37aa798cda362 to your computer and use it in GitHub Desktop.
#update packages
sudo apt-get update
#install git
sudo apt-get install git
#download nodejs
cd ~
wget https://nodejs.org/dist/v4.3.2/node-v4.3.2-linux-x64.tar.xz
#create directory and put node on it
mkdir node
tar xvf node-v*.tar.?z --strip-components=1 -C ./node
#delete downloaded version
cd ~
rm -rf node-v*
#create directory and move content
mkdir node/etc
echo 'prefix=/usr/local' > node/etc/npmrc
sudo mv node /opt/
#give permissions
sudo chown -R root: /opt/node
sudo ln -s /opt/node/bin/node /usr/local/bin/node
sudo ln -s /opt/node/bin/npm /usr/local/bin/npm
#check versions
node -v
npm -v
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment