From 2d2e7360c0adea1c8303fe0b1659009c43204199 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 4 Jun 2017 16:06:00 +0100 Subject: [PATCH] Remove nodejs install if it exists --- src/freedombone-utils-nodejs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index b2847379..a799ea9d 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -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