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"
43
43
44
44
installNodejs () {
45
45
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
48
51
local ERROR_MESSAGE=$( ErrorMessage " run.sh" " 0205" )
49
52
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
52
60
fi
53
61
echo " $msg3 "
54
62
node --version
You can’t perform that action at this time.
0 commit comments