Always install nodejs from nodesource

It appears that the xenial LTS packages are not staying up-to-date
with the latest LTS releases of NodeJS and NPM. This patch removes the
distro condition that toggles installs, instead relying on the upstream
package we use from NodeSource directly.

Change-Id: I273ebcf85f8fcb09938149a2e30e22fbbbd96dd5
This commit is contained in:
Michael Krotscheck
2016-07-06 20:26:32 +01:00
parent 76ccdc1f54
commit 50e68abc4a

View File

@@ -231,18 +231,15 @@
sudo apt-get install -y apt-transport-https lsb-release curl
DISTRO=$(lsb_release -c -s)
if [[ ${DISTRO} == "trusty" ]]; then
# Install via nodesource
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
echo 'deb https://deb.nodesource.com/node_4.x trusty main' | sudo tee /etc/apt/sources.list.d/nodesource.list
echo 'deb-src https://deb.nodesource.com/node_4.x trusty main' | sudo tee -a /etc/apt/sources.list.d/nodesource.list
# Install via nodesource
curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y nodejs
elif [[ ${DISTRO} == "xenial" ]]; then
sudo apt-get install -y nodejs nodejs-legacy npm
fi
echo "deb https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee /etc/apt/sources.list.d/nodesource.list
echo "deb-src https://deb.nodesource.com/node_4.x $DISTRO main" | sudo tee -a /etc/apt/sources.list.d/nodesource.list
sudo apt-get update
sudo apt-get install -y nodejs
# Output to the log for debugging's sake.
node --version