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 apt-get update
if [ -f /usr/bin/nodejs ]; then apt-get -yq remove --purge nodejs
apt-get -yq remove --purge nodejs
fi
if [ -d /usr/local/lib/node_modules ]; then if [ -d /usr/local/lib/node_modules ]; then
rm -rf /usr/local/lib/node_modules rm -rf /usr/local/lib/node_modules
fi fi
@ -165,7 +164,8 @@ function install_nodejs {
rm /usr/bin/nodejs rm /usr/bin/nodejs
fi fi
apt-get -yq install nodejs curl apt-get -yq install nodejs
apt-get -yq install curl
if [ ! -f /usr/bin/nodejs ]; then if [ ! -f /usr/bin/nodejs ]; then
echo $'nodejs was not installed' echo $'nodejs was not installed'