Skip to content

Commit 68f766f

Browse files
committed
fix: upgrade to Node 22 and fix npm lockfile incompatibility
Lockfile generated by local npm 11 was incompatible with npm 10 (bundled in node:20-alpine), causing npm ci to fail with missing packages. Switch to node:22-alpine and use npm install instead of npm ci to tolerate cross-version lockfiles.
1 parent 4b97949 commit 68f766f

2 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/ci.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
cache: "npm"
3333

3434
- name: Install dependencies
35-
run: npm ci --legacy-peer-deps
35+
run: npm install
3636

3737
- name: Generate Prisma clients
3838
run: npm run db:generate
@@ -64,7 +64,7 @@ jobs:
6464
cache: "npm"
6565

6666
- name: Install dependencies
67-
run: npm ci --legacy-peer-deps
67+
run: npm install
6868

6969
- name: Generate Prisma clients
7070
run: npm run db:generate
@@ -98,7 +98,7 @@ jobs:
9898
cache: "npm"
9999

100100
- name: Install dependencies
101-
run: npm ci --legacy-peer-deps
101+
run: npm install
102102

103103
- name: Generate Prisma clients
104104
run: npm run db:generate

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
# -----------------------------------------------------------------------------
1111
# Base stage - shared dependencies
1212
# -----------------------------------------------------------------------------
13-
FROM node:20-alpine AS base
13+
FROM node:22-alpine AS base
1414

1515
# Install dependencies for Prisma and other native modules
1616
RUN apk add --no-cache libc6-compat openssl
@@ -25,12 +25,11 @@ FROM base AS deps
2525
# Copy package files
2626
COPY package.json package-lock.json* ./
2727

28-
# Install dependencies using npm ci (faster for CI/Docker)
29-
# Uses BuildKit cache mount for npm cache (~30-50% faster on rebuilds)
28+
# npm install (not ci) tolerates lockfiles across npm versions (local npm 11 vs Docker npm 10)
3029
# Cache keyed by TARGETPLATFORM to avoid ETXTBSY on QEMU cross-compilation
3130
ARG TARGETPLATFORM
3231
RUN --mount=type=cache,target=/root/.npm,id=npm-${TARGETPLATFORM} \
33-
npm ci
32+
npm install
3433

3534
# -----------------------------------------------------------------------------
3635
# Builder stage - build the application

0 commit comments

Comments
 (0)