Created
November 7, 2016 13:55
-
-
Save csanquer/c01bcd3857c878a55415d7275b315216 to your computer and use it in GitHub Desktop.
Install nodejs ubuntu/debian
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/bash | |
# VERSION=node_7.x | |
# VERSION=node_6.x | |
# VERSION=node_5.x | |
# VERSION=node_4.x | |
# VERSION=node_0.12 | |
VERSION=node_0.10 | |
DISTRO="$(lsb_release -s -c)" | |
echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list | |
echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list | |
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add - | |
cat <<EOF | sudo tee /etc/apt/preferences.d/nodesource | |
Package: * | |
Pin: origin deb.nodesource.com | |
Pin-Priority: 600 | |
EOF | |
sudo apt-get update | |
sudo apt-get install nodejs | |
node -v | |
npm -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment