chore: migrate Node.js from v18.x to v22.x (#2491)

This commit is contained in:
Nico Miguelino
2025-09-05 19:03:39 -07:00
committed by GitHub
parent 9f76df3772
commit 6a822b8fe6
6 changed files with 26 additions and 24 deletions

View File

@@ -1,10 +1,7 @@
{% if environment == 'production' %}
FROM debian:bookworm AS node-builder
RUN apt-get update && \
apt-get -y install \
nodejs \
npm
{% include 'nodejs-install.j2' %}
RUN mkdir -p /app
WORKDIR /app
@@ -40,6 +37,8 @@ WORKDIR /usr/src/app
COPY --from=node-builder \
/app/static/dist/ \
/usr/src/app/static/dist/
{% else %}
{% include 'nodejs-install.j2' %}
{% endif %}
ENV GIT_HASH={{ git_hash }}

View File

@@ -34,6 +34,8 @@ RUN --mount=type=cache,target=/var/cache/apt \
{% endif %}
{% endfor %}
{% include 'nodejs-install.j2' %}
# @TODO: Uncomment the lines below when test_add_asset_streaming is fixed.
# WORKDIR /opt/ffmpeg
# COPY --from=builder /opt/ffmpeg/ffserver ./

13
docker/nodejs-install.j2 Normal file
View File

@@ -0,0 +1,13 @@
{% if board in ['pi1', 'pi2'] %}
RUN apt-get update && \
apt-get -y install \
nodejs \
npm
{% else %}
RUN apt-get update && \
apt-get -y install \
curl \
ca-certificates && \
curl -fsSL https://deb.nodesource.com/setup_22.x | bash - && \
apt-get -y install nodejs
{% endif %}

23
package-lock.json generated
View File

@@ -1887,13 +1887,11 @@
}
},
"node_modules/@babel/runtime": {
"version": "7.26.7",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.26.7.tgz",
"integrity": "sha512-AOPI3D+a8dXnja+iwsUqGRjr1BbZIe771sXdapOtYI531gSqpi92vXivKcq2asu/DFpdl1ceFAKZyRzK2PCVcQ==",
"version": "7.28.3",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.28.3.tgz",
"integrity": "sha512-9uIQ10o0WGdpP6GDhXcdOJPJuDgFtIDtN/9+ArJQ2NAfAmiuhTQdzkaTGR33v43GYS2UrSA0eX2pPPHoFVvpxA==",
"dev": true,
"dependencies": {
"regenerator-runtime": "^0.14.0"
},
"license": "MIT",
"engines": {
"node": ">=6.9.0"
}
@@ -5357,10 +5355,11 @@
}
},
"node_modules/brace-expansion": {
"version": "1.1.11",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
"integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
"version": "1.1.12",
"resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",
"integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==",
"dev": true,
"license": "MIT",
"dependencies": {
"balanced-match": "^1.0.0",
"concat-map": "0.0.1"
@@ -10664,12 +10663,6 @@
"node": ">=4"
}
},
"node_modules/regenerator-runtime": {
"version": "0.14.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz",
"integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==",
"dev": true
},
"node_modules/regexp.prototype.flags": {
"version": "1.5.4",
"resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.4.tgz",

View File

@@ -93,9 +93,6 @@ def build_image(
context.update(get_test_context())
elif service == 'wifi-connect':
context.update(get_wifi_connect_context(target_platform))
elif service == 'server':
if environment == 'development':
base_apt_dependencies.extend(['nodejs', 'npm'])
generate_dockerfile(service, {
'base_image': base_image,

View File

@@ -90,8 +90,6 @@ def get_test_context() -> dict:
'libcups2',
'libxcomposite1',
'libxdamage1',
'nodejs',
'npm',
],
'chrome_dl_url': chrome_dl_url,
'chromedriver_dl_url': chromedriver_dl_url,