From 5d61b29d95dd5c84f962504a25ff1324f8a6bdb7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 6 Jun 2017 11:00:02 +0100 Subject: [PATCH] Always try to uninstall nodejs before installing it --- src/freedombone-utils-nodejs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/freedombone-utils-nodejs b/src/freedombone-utils-nodejs index f0c0f16d..6a3054ca 100755 --- a/src/freedombone-utils-nodejs +++ b/src/freedombone-utils-nodejs @@ -149,9 +149,8 @@ function install_nodejs { apt-get update - if [ -f /usr/bin/nodejs ]; then - apt-get -yq remove --purge nodejs - fi + apt-get -yq remove --purge nodejs + if [ -d /usr/local/lib/node_modules ]; then rm -rf /usr/local/lib/node_modules fi @@ -165,7 +164,8 @@ function install_nodejs { rm /usr/bin/nodejs fi - apt-get -yq install nodejs curl + apt-get -yq install nodejs + apt-get -yq install curl if [ ! -f /usr/bin/nodejs ]; then echo $'nodejs was not installed'