Always try to uninstall nodejs before installing it

This commit is contained in:
Bob Mottram 2017-06-06 11:00:02 +01:00
parent a5fe0462de
commit 5d61b29d95
1 changed files with 4 additions and 4 deletions

View File

@ -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'