Skip to content

Fix the pnpm-in-container path: pnpm missing from the nodejs image, s/yarn drops its args - #747

Open
IvanTheGeek wants to merge 1 commit into
debiki:mainfrom
IvanTheGeek:fix-nodejs-pnpm
Open

Fix the pnpm-in-container path: pnpm missing from the nodejs image, s/yarn drops its args#747
IvanTheGeek wants to merge 1 commit into
debiki:mainfrom
IvanTheGeek:fix-nodejs-pnpm

Conversation

@IvanTheGeek

Copy link
Copy Markdown

Two small pnpm-migration leftovers that break the pnpm-in-container path:

  1. The nodejs image has no pnpm. node:24.14.0-trixie-slim doesn't bundle it (and Nodejs is phasing out bundled corepack), so anything doing docker compose run --rm nodejs pnpm ... fails with pnpm: command not found. That's s/yarn, and therefore the make node_modules fallback — which a fresh clone hits if the vendored node_modules submodule isn't initialized yet. Fix: install pnpm explicitly in images/nodejs/Dockerfile.

  2. s/yarn dropped its arguments. It ran bare pnpm (no "$@"), which just prints pnpm's usage and installs nothing. Now it passes arguments through, and with no arguments runs pnpm install (like bare yarn used to), which is what make node_modules expects.

Verified after the fix: docker compose run --rm nodejs pnpm --version → 10.34.5, and s/yarn --version works.

Deliberately not touched: the to-talkyard Makefile target that still calls yarn — you mentioned on Ivan's forum that a fix for that is already on a private branch, so this PR stays out of its way. (Found while making the build run with only Docker on the host; more on that experiment soon in the contributor-friendly thread.)

🤖 Generated with Claude Code

The nodejs image (node:24.14.0-trixie-slim) ships no pnpm, so everything
that runs pnpm inside the container fails with 'pnpm: command not found':
s/yarn, and thus 'make node_modules' whenever ./node_modules (the
vendored submodule) is absent, e.g. on a fresh clone before submodule
init. Nodejs is phasing out bundled corepack, so install pnpm explicitly
in the image.

Also, s/yarn dropped its arguments — it ran bare 'pnpm', which only
prints pnpm's usage text and installs nothing. Now it passes "$@"
through, and with no arguments runs 'pnpm install' (like bare 'yarn'
used to do), which is what the 'make node_modules' fallback expects.

Verified: 'docker compose run --rm nodejs pnpm --version' -> 10.34.5,
and 's/yarn --version' works.

(The to-talkyard Makefile target still calling yarn is deliberately NOT
touched here — per the forum discussion, a fix for that is already on a
private branch.)

Co-authored-by: Claude Fable 5 <noreply@anthropic.com>

I, Ivan Rainbolt <talkyard@github-commits.ivanthegeek.com>, agree to the Contributor License Agreement, docs/CLA-v2.txt.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant