Skip to content

Commit 8b8035f

Browse files
emloweseeden
andauthored
Change minimium node version to 20 and npm version to 10 (#19845)
* Update to node 20 * Update another script for minimum npm version * update check for npm >= 10 * update npm version --------- Co-authored-by: Zlatko <[email protected]>
1 parent 96d1356 commit 8b8035f

File tree

6 files changed

+46
-29
lines changed

6 files changed

+46
-29
lines changed

.github/workflows/build-macos-installers.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ jobs:
176176

177177
- uses: chia-network/actions/activate-venv@main
178178

179-
- name: Setup Node 18.x
179+
- name: Setup Node 20.x
180180
uses: actions/setup-node@v4
181181
with:
182-
node-version: "18.x"
182+
node-version: "20.x"
183183

184184
- name: Prepare GUI cache
185185
id: gui-ref

.github/workflows/build-windows-installer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,10 @@ jobs:
9595
with:
9696
python-version: ${{ matrix.python-version }}
9797

98-
- name: Setup Node 18.x
98+
- name: Setup Node 20.x
9999
uses: actions/setup-node@v4
100100
with:
101-
node-version: "18.x"
101+
node-version: "20.x"
102102

103103
- name: Test for secrets access
104104
id: check_secrets

build_scripts/npm_global/package-lock.json

Lines changed: 23 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build_scripts/npm_global/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,6 @@
1010
"author": "",
1111
"license": "ISC",
1212
"dependencies": {
13-
"n": "^8.2.0"
13+
"n": "^10.2.0"
1414
}
1515
}

install-gui.sh

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -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

start-gui.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ if ! npm version >/dev/null 2>&1; then
3232
fi
3333

3434
NPM_VERSION="$(npm -v | cut -d'.' -f 1)"
35-
if [ "$NPM_VERSION" -lt "9" ]; then
36-
echo "Current npm version($(npm -v)) is less than 9. GUI app requires npm>=9."
35+
if [ "$NPM_VERSION" -lt "10" ]; then
36+
echo "Current npm version($(npm -v)) is less than 10. GUI app requires npm>=10."
3737
exit 1
3838
else
3939
echo "Found npm $(npm -v)"

0 commit comments

Comments
 (0)