Remove nodejs install if it exists

This commit is contained in:
Bob Mottram 2017-06-04 16:06:00 +01:00
parent f4137c28d1
commit 2d2e7360c0
1 changed files with 8 additions and 0 deletions

View File

@ -149,6 +149,14 @@ function install_nodejs {
echo "deb-src https://deb.nodesource.com/node_6.x jessie main" >> /etc/apt/sources.list.d/nodesource.list
apt-get update
if [ -f /usr/bin/nodejs ]; then
apt-get -yq remove --purge nodejs
fi
if [ -d /usr/local/lib/node_modules ]; then
rm -rf /usr/local/lib/node_modules
fi
apt-get -yq install nodejs curl
if [ ! -f /usr/bin/nodejs ]; then