Replace default nodejs v10 in debian 10 if installed

This commit is contained in:
ronivay
2020-04-06 12:10:39 +03:00
parent d983287b04
commit 78bcd027a5
2 changed files with 12 additions and 1 deletions

View File

@@ -107,7 +107,7 @@ Debian/Ubuntu:
- libcap2-bin
- curl
- yarn
- nodejs (v12)
- nodejs (v12) (possible debian 10 default nodejs v10 will be replaced)
- npm (v3)
- build-essential
- redis-server

View File

@@ -194,6 +194,17 @@ function InstallDependenciesDebian {
echo -e "\r${OK} Installing node.js"
fi
# if we run Debian 10 and have default nodejs v10 installed, then replace it with node 12.x
if [[ $OSVERSION == "10" ]]; then
NODEV=$(node -v 2>/dev/null| grep -Eo '[0-9.]+' | cut -d'.' -f1)
if [[ ! -z $NODEV ]] &&[[ $NODEV < 12 ]]; then
echo
echo -ne "${PROGRESS} Installing node.js"
curl -sL https://deb.nodesource.com/setup_12.x | bash - >/dev/null
apt-get install -y nodejs >/dev/null
echo -e "\r${OK} Installing node.js"
fi
fi
# install packages
echo