@@ -40,17 +40,17 @@ do_install_npm_locally() {
40
40
NODEJS_VERSION=" $( node -v | cut -d' .' -f 1 | sed -e ' s/^v//' ) "
41
41
NPM_VERSION=" $( npm -v | cut -d' .' -f 1) "
42
42
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 ."
46
46
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 ."
49
49
fi
50
50
51
51
if [ " $( uname) " = " OpenBSD" ] || [ " $( uname) " = " FreeBSD" ]; then
52
52
# `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"
54
54
exit 1
55
55
fi
56
56
@@ -70,17 +70,17 @@ do_install_npm_locally() {
70
70
export N_PREFIX=${SCRIPT_DIR} /.n
71
71
PATH=" ${N_PREFIX} /bin:$( npm prefix) /node_modules/.bin:${PATH} "
72
72
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
76
76
echo " Current NodeJS version: $( node -v) "
77
77
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 "
80
80
exit 1
81
81
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 "
84
84
exit 1
85
85
fi
86
86
cd " ${SCRIPT_DIR} "
@@ -131,23 +131,23 @@ if [ "$(uname)" = "Linux" ]; then
131
131
# AMZN 2
132
132
if ! nodejs_is_installed; then
133
133
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 -
135
135
sudo yum install -y nodejs
136
136
fi
137
137
do_install_npm_locally
138
138
elif type yum > /dev/null 2>&1 && [ ! -f /etc/rocky-release ] && [ ! -f /etc/fedora-release ] && [ -f /etc/redhat-release ] || [ -f /etc/centos-release ]; then
139
139
# CentOS or Redhat
140
140
if ! nodejs_is_installed; then
141
141
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 -
143
143
sudo yum install -y nodejs
144
144
fi
145
145
do_install_npm_locally
146
146
elif type yum > /dev/null 2>&1 && [ -f /etc/rocky-release ] || [ -f /etc/fedora-release ]; then
147
147
# RockyLinux
148
148
if ! nodejs_is_installed; then
149
149
echo " Installing nodejs on RockyLinux/Fedora"
150
- sudo dnf module enable nodejs:12
150
+ sudo dnf module enable nodejs:20
151
151
sudo dnf install -y nodejs
152
152
fi
153
153
do_install_npm_locally
0 commit comments