diff --git a/README.md b/README.md index 6ed8f7a..a4e7fc8 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/xo-install.sh b/xo-install.sh index a9f2c90..57a40cb 100755 --- a/xo-install.sh +++ b/xo-install.sh @@ -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