File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -43,12 +43,20 @@ echo "$msg1"
4343
4444installNodejs () {
4545 echo " $msg2 "
46- sudo apt update -qq && sudo apt install -y nodejs npm > /dev/null 2>&1
47- if [ $? -ne 0 ]; then
46+ sudo apt-get remove -y nodejs npm || true
47+ sudo apt-get update -qq
48+ curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
49+ sudo apt-get install -y nodejs
50+ if ! command -v node > /dev/null; then
4851 local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0205" )
4952 echo " $ERROR_MESSAGE "
50- sudo apt update
51- sudo apt install -y nodejs npm
53+ sudo apt update -qq && sudo apt install -y nodejs npm > /dev/null 2>&1
54+ if [ $? -ne 0 ]; then
55+ local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0205" )
56+ echo " $ERROR_MESSAGE "
57+ sudo apt update
58+ sudo apt install -y nodejs npm
59+ fi
5260 fi
5361 echo " $msg3 "
5462 node --version
You can’t perform that action at this time.
0 commit comments