@@ -40,17 +40,17 @@ do_install_npm_locally() {
4040 NODEJS_VERSION=" $( node -v | cut -d' .' -f 1 | sed -e ' s/^v//' ) "
4141 NPM_VERSION=" $( npm -v | cut -d' .' -f 1) "
4242
43- if [ " $NODEJS_VERSION " -lt " 18 " ] || [ " $NPM_VERSION " -lt " 9 " ]; then
44- if [ " $NODEJS_VERSION " -lt " 18 " ]; then
45- echo " Current NodeJS version($( node -v) ) is less than 18 . GUI app requires NodeJS>=18 ."
43+ if [ " $NODEJS_VERSION " -lt " 20 " ] || [ " $NPM_VERSION " -lt " 10 " ]; then
44+ if [ " $NODEJS_VERSION " -lt " 20 " ]; then
45+ echo " Current NodeJS version($( node -v) ) is less than 20 . GUI app requires NodeJS>=20 ."
4646 fi
47- if [ " $NPM_VERSION " -lt " 9 " ]; then
48- echo " Current npm version($( npm -v) ) is less than 9 . GUI app requires npm>=9 ."
47+ if [ " $NPM_VERSION " -lt " 10 " ]; then
48+ echo " Current npm version($( npm -v) ) is less than 10 . GUI app requires npm>=10 ."
4949 fi
5050
5151 if [ " $( uname) " = " OpenBSD" ] || [ " $( uname) " = " FreeBSD" ]; then
5252 # `n` package does not support OpenBSD/FreeBSD
53- echo " Please install NodeJS>=18 and/or npm>=9 manually"
53+ echo " Please install NodeJS>=20 and/or npm>=10 manually"
5454 exit 1
5555 fi
5656
@@ -70,17 +70,17 @@ do_install_npm_locally() {
7070 export N_PREFIX=${SCRIPT_DIR} /.n
7171 PATH=" ${N_PREFIX} /bin:$( npm prefix) /node_modules/.bin:${PATH} "
7272 export PATH
73- # `n 18 ` here installs nodejs@18 under $N_PREFIX directory
74- echo " n 18 "
75- n 18
73+ # `n 20 ` here installs nodejs@20 under $N_PREFIX directory
74+ echo " n 20 "
75+ n 20
7676 echo " Current NodeJS version: $( node -v) "
7777 echo " Current npm version: $( npm -v) "
78- if [ " $( node -v | cut -d' .' -f 1 | sed -e ' s/^v//' ) " -lt " 18 " ]; then
79- echo " Error: Failed to install NodeJS>=18 "
78+ if [ " $( node -v | cut -d' .' -f 1 | sed -e ' s/^v//' ) " -lt " 20 " ]; then
79+ echo " Error: Failed to install NodeJS>=20 "
8080 exit 1
8181 fi
82- if [ " $( npm -v | cut -d' .' -f 1) " -lt " 9 " ]; then
83- echo " Error: Failed to install npm>=9 "
82+ if [ " $( npm -v | cut -d' .' -f 1) " -lt " 10 " ]; then
83+ echo " Error: Failed to install npm>=10 "
8484 exit 1
8585 fi
8686 cd " ${SCRIPT_DIR} "
@@ -131,23 +131,23 @@ if [ "$(uname)" = "Linux" ]; then
131131 # AMZN 2
132132 if ! nodejs_is_installed; then
133133 echo " Installing nodejs on Amazon Linux 2."
134- curl -sL https://rpm.nodesource.com/setup_12 .x | sudo bash -
134+ curl -sL https://rpm.nodesource.com/setup_20 .x | sudo bash -
135135 sudo yum install -y nodejs
136136 fi
137137 do_install_npm_locally
138138 elif type yum > /dev/null 2>&1 && [ ! -f /etc/rocky-release ] && [ ! -f /etc/fedora-release ] && [ -f /etc/redhat-release ] || [ -f /etc/centos-release ]; then
139139 # CentOS or Redhat
140140 if ! nodejs_is_installed; then
141141 echo " Installing nodejs on CentOS/Redhat."
142- curl -sL https://rpm.nodesource.com/setup_12 .x | sudo bash -
142+ curl -sL https://rpm.nodesource.com/setup_20 .x | sudo bash -
143143 sudo yum install -y nodejs
144144 fi
145145 do_install_npm_locally
146146 elif type yum > /dev/null 2>&1 && [ -f /etc/rocky-release ] || [ -f /etc/fedora-release ]; then
147147 # RockyLinux
148148 if ! nodejs_is_installed; then
149149 echo " Installing nodejs on RockyLinux/Fedora"
150- sudo dnf module enable nodejs:12
150+ sudo dnf module enable nodejs:20
151151 sudo dnf install -y nodejs
152152 fi
153153 do_install_npm_locally
0 commit comments