Use npm 11 in build stage to match the lockfile

node:22 ships npm 10, which rejects the npm-11-generated package-lock
("Missing: @emnapi/core"). Upgrade npm to 11 before npm ci.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jean-Luc Makiola
2026-06-28 13:50:36 +02:00
parent 2665cd7f25
commit eac3dddf40

View File

@@ -1,9 +1,13 @@
# --- Build stage: produce static dist/ --- # --- Build stage: produce static dist/ ---
# Debian (glibc), not alpine: Astro 7's Rust toolchain (rolldown/oxc) has # Debian (glibc), not alpine: Astro 7's Rust toolchain (rolldown/oxc) resolves
# flaky musl native bindings, and the lockfile is resolved for linux-x64-gnu. # cleanly against the linux-x64-gnu lockfile entries.
FROM node:22-slim AS build FROM node:22-slim AS build
WORKDIR /app WORKDIR /app
# The lockfile is generated by npm 11; node:22 ships npm 10, which rejects it
# ("Missing: @emnapi/core ..."). Match the generator before installing.
RUN npm install -g npm@11
# Install deps against the lockfile for reproducible builds. # Install deps against the lockfile for reproducible builds.
COPY package.json package-lock.json* ./ COPY package.json package-lock.json* ./
RUN npm ci RUN npm ci