Skip to content

feat(node): include corepack shims in runtime image for Node 25+#568

Merged
iloveitaly merged 8 commits into
railwayapp:mainfrom
iloveitaly:node-25-corepack
Jun 1, 2026
Merged

feat(node): include corepack shims in runtime image for Node 25+#568
iloveitaly merged 8 commits into
railwayapp:mainfrom
iloveitaly:node-25-corepack

Conversation

@iloveitaly

@iloveitaly iloveitaly commented May 30, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Node.js 25+ no longer ships Corepack. Railpack installs and activates it during the build, but corepack prepare mutates the mise-managed Node install (global packages and shims). Those paths were not copied into the runtime image, so pnpm run start failed with pnpm: command not found.

Fixes #563

Description

When Corepack is used, the Node provider now adds /mise/installs and /mise/shims to buildIncludeDirs alongside the existing /opt/corepack include. That captures the package-manager binaries and symlinks created after the initial mise install step, so they are present in the final runtime layer without a separate Corepack install at deploy time.

Documentation in the developing-locally guide covers Node 25 Corepack behavior, shim layout, and why those directories must be included from the build step.

Test

  • Added examples/node-pnpm-corepack-runtime: Node 25, packageManager: pnpm, Corepack during build, pnpm run start at runtime.
  • Integration test asserts Node v25 and that the app starts via pnpm; allows pnpm 11 stderr from the invoked script.

@iloveitaly iloveitaly changed the title node 25 corepack fix(node): corepack with latest node versions May 30, 2026
@iloveitaly iloveitaly changed the title fix(node): corepack with latest node versions feat(node): include corepack shims in runtime image for Node 25+ May 30, 2026
- Introduce a new example project demonstrating Node.js 25+ integration with Corepack and pnpm.
- Includes a test specification to verify runtime version and execution flow.

Generated-by: aiautocommit
- Explain the shift in corepack availability and requirement in Node 25+.
- Detail the directory structure for shims and the impact on the build process.
- Update maintenance documentation to include pnpm lockfile version mapping.

Generated-by: aiautocommit
* Include /mise/installs and /mise/shims in buildIncludeDirs when using corepack.
* This ensures that binaries like pnpm are correctly captured in the final image despite runtime mutations performed by corepack.

Generated-by: aiautocommit
- Include `/mise/installs` and `/mise/shims` in the build plan snapshots to support mise-managed toolchains.
- Update pnpm-corepack-runtime snapshot to reflect current install and build command logic.

Generated-by: aiautocommit
- Rename node-pnpm-corepack-runtime to pnpm-corepack-runtime-usage to better reflect its purpose.
- Update node engine version to v26 in example configuration.
- Update test expectation to match the new node version.

Generated-by: aiautocommit
@iloveitaly iloveitaly merged commit 04bff80 into railwayapp:main Jun 1, 2026
231 checks passed
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.

pnpm: command not found at runtime when using Corepack with Node.js 25+

1 participant