Skip to content

Commit

Permalink
Merge pull request #672 from DmitriyStoyanov/update-nodejs
Browse files Browse the repository at this point in the history
Update Node.js to version 20.x
  • Loading branch information
claud-io authored Dec 2, 2024
2 parents 4cda383 + 558a2a0 commit f0ee0ca
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ FROM ubuntu:22.04 as production
ARG TIMEZONE=UTC

### UPDATE ###
RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN curl -sL https://deb.nodesource.com/setup_20.x | bash -
RUN apt update

### INSTALL APT-GET LIBS ###
Expand Down Expand Up @@ -68,4 +68,4 @@ RUN mv wptagent.py wptagent_starter.py
COPY wptagent_debug.py wptagent.py

### SETTING PRODUCTION BUILD AS DEFAULT ###
FROM production
FROM production
2 changes: 1 addition & 1 deletion centos_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ until python3 -m pip install --user -r .github/workflows/requirements.txt
do
sleep 1
done
curl --silent --location https://rpm.nodesource.com/setup_16.x | sudo bash -
curl --silent --location https://rpm.nodesource.com/setup_20.x | sudo bash -
until sudo yum -y install nodejs
do
sleep 1
Expand Down
2 changes: 1 addition & 1 deletion docs/install.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ wptagent currently supports Windows, Linux and OSX for desktop browsers as well
## For lighthouse testing
* NodeJS
* Ubuntu/Debian:
* ```curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -```
* ```curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -```
* ```sudo apt-get install -y nodejs```
* The lighthouse npm module
* ```sudo npm install -g lighthouse```
Expand Down
2 changes: 1 addition & 1 deletion ubuntu_install.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ do
done

# Prepare Node for install
curl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -
curl -sL https://deb.nodesource.com/setup_20.x | sudo -E bash -

# Install all of the binary dependencies
echo ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula select true | sudo debconf-set-selections
Expand Down
12 changes: 6 additions & 6 deletions wptagent.py
Original file line number Diff line number Diff line change
Expand Up @@ -574,16 +574,16 @@ def startup(self, detected_browsers):
except Exception:
pass

# Check for Node 16+
if self.get_node_version() < 16.0:
# Check for Node 18+
if self.get_node_version() < 18.0:
if platform.system() == "Linux":
# This only works on debian-based systems
logging.debug('Updating Node.js to 16.x')
logging.debug('Updating Node.js to 20.x')
subprocess.call('sudo apt -y install curl dirmngr apt-transport-https lsb-release ca-certificates', shell=True)
subprocess.call('curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -', shell=True)
subprocess.call('curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -', shell=True)
subprocess.call(['sudo', 'apt-get', 'install', '-y', 'nodejs'])
if self.get_node_version() < 16.0:
logging.warning("Node.js 16 or newer is required for Lighthouse testing")
if self.get_node_version() < 18.0:
logging.warning("Node.js 18 or newer is required for Lighthouse testing")

# Force lighthouse 11.4.0
if self.get_lighthouse_version() != '11.4.0':
Expand Down

0 comments on commit f0ee0ca

Please sign in to comment.