Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Node.js 24 Corepack enabled by default💡 Result:
Short answer: No — Node.js 24 ships Corepack but it is not enabled by default. You must run corepack enable (or use corepack use/install) to activate its shims. Corepack is distributed with Node.js through v24 but the project has decided to stop bundling it in future (25+). [1][2][3]
Sources:
[1] Node.js Corepack docs (v24/nightly) — explains Corepack is included and “needs to be explicitly enabled”.
[2] nodejs/corepack README — notes Corepack is distributed with Node.js from 14.19.0 up to (but not including) 25.0.0.
[3] Reporting on Node TSC decision / GitHub discussion — TSC voted to stop distributing Corepack for future releases (impacting 25+).
🌐 Web query:
devcontainers typescript-node:24 Corepack configuration💡 Result:
Short answer + examples.
Why: Node images (including mcr.microsoft.com/devcontainers/typescript-node:24) may include Node.js with Corepack, but you should enable/prepare Corepack and ensure COREPACK_HOME is writable so pnpm/yarn are available predictably. [1][2][3]
Recommended options (pick one):
This enables Corepack and activates the pnpm shim for the container session. [1][2]
&& corepack prepare pnpm@9.*/--activate
Make sure COREPACK_HOME is writable during prepare (avoid read-only Node install dirs). If your build environment uses a read-only install, set COREPACK_HOME to a writable path (e.g. /usr/local/share/corepack) and add it to PATH. [1][3]
This writes packageManager to package.json so Corepack will always use that version for the project. (If auto-pin doesn’t happen in your workflow, run the command explicitly or add packageManager manually). [2]
Example devcontainer.json snippet
"image": "mcr.microsoft.com/devcontainers/typescript-node:24",
"postCreateCommand": "corepack enable && corepack prepare [email protected] --activate"
}
Example Dockerfile snippet
ENV COREPACK_HOME=/usr/local/share/corepack
RUN mkdir -p $COREPACK_HOME && chown root:root $COREPACK_HOME &&
corepack enable && corepack prepare [email protected] --activate
Notes / gotchas
Sources
Do not remove
corepack enable—pnpm installwill fail without it.Node.js 24 includes Corepack but does not enable it by default. The
mcr.microsoft.com/devcontainers/typescript-node:24image likewise does not enable Corepack by default. Withoutcorepack enable, the pnpm shims are unavailable, andpnpm install --frozen-lockfilewill fail during dev container initialization.Restore
corepack enable &&in theupdateContentCommand, or move the Corepack activation topostCreateCommandor the Dockerfile if you prefer that approach.🤖 Prompt for AI Agents