published fresh until

pnpm: deploy one workspace package across versions

Summary Check the pnpm version before enabling injection: current deployment supports linked workspace dependencies, while older implementations require injection or legacy mode. Export one package with pnpm --filter=<deployed-project> --prod deploy <target-directory>

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

Do first: run pnpm --version in the workspace, then choose the deploy branch for that version before changing injectWorkspacePackages.

Short answer

As of November 2026, pnpm 12.23.0 has a release listing. Current deploy docs say injection is no longer required since 12.2.0. The 10.x deploy documentation requires injected workspace dependencies unless legacy mode is selected. Do not apply the old error's setting advice indiscriminately to current deployments.

Choose / don't choose

  • Current dedicated deploy lockfile: choose on the current stable release; don't turn on injection solely to satisfy the obsolete blanket requirement. Linked dependencies are rewritten into the dedicated deploy graph (deploy).
  • Older injection-required implementation: choose injectWorkspacePackages: true and maintain built copies when that deployment behavior is desired; don't assume source symlink updates refresh injected files (workspace settings).
  • Legacy implementation: choose pnpm deploy --legacy when retaining the older deployment algorithm or using deploy without inject-workspace-packages=true. Don't treat it as identical lockfile generation: it disables dedicated-lockfile creation from the shared lockfile (10.x deploy).

Not for: compiling shared package exports; see javascript-monorepos-share-built-packages-pnpm-exports.

Settings that matter

Setting or flagValue / defaultApplies toSource
injectWorkspacePackagestrue enables injection; default falseCurrent workspace docsworkspace, 10.x
--filterSelect exactly one deployed project: pnpm --filter=<deployed-project> --prod deploy <target-directory>Current deploydeploy
--prodExclude devDependencies; build using development tools before exportingCurrent and 10.x deploy10.x
--legacy / forceLegacyDeploy--legacy forces the legacy implementation; forceLegacyDeploy: true selects legacy behavior; default falseCurrent and 10.x deploy10.x
syncInjectedDepsAfterScriptsList script names; default undefinedCurrent injection behaviorworkspace
overridesPin an ambiguous peer to one version, or use injection to disambiguateCurrent linked-workspace deploy pathdeploy

The 12.2.0 release and current deploy docs say injection is no longer required since 12.2.0. ak99372's April 7, 2025 request records ERR_PNPM_DEPLOY_NONINJECTED_WORKSPACE; zkochan points to legacy mode and injected-copy synchronization. Those comments describe the old behavior.

Order of operations

1. Align the workspace/CI pnpm pin and inspect which deployment implementation actually runs. Injection settings belong to workspace installation, not only a last-minute deploy command. 2. If adopting injection, build producer packages and synchronize the injected copies after the relevant scripts (workspace). 3. Build the application, then deploy one selected project with --prod to a separate target directory (deployment). 4. Move/copy that output outside the source workspace and run its real entry point with only its deployed files and dependencies. Inspect that required build artifacts are present; file inclusion uses the documented files, .npmignore and .gitignore rules (10.x file selection).

Known failures and fixes

Error (short quote)CauseFixSource
ERR_PNPM_DEPLOY_NONINJECTED_WORKSPACEThe report says pnpm v10 deploy requires inject-workspace-packages=trueConfirm the running pin; choose legacy to deploy without injection2025 report, 10.x docs
ERR_PNPM_DEPLOY_AMBIGUOUS_PEERThe deploy error names the package, peer and competing resolutionsInspect the reported resolutions; pin one with overrides or enable injectioncurrent deploy

Missing

  • The linked source does not confirm: change workspace settings and run pnpm install to reconcile the install/lockfile
  • No project's peer graph, build script names or artifact paths are specified; a universal override version or production entry point cannot be selected.

Checked

2026-11-24; pnpm 12.23.0 release, current/10.x deploy and workspace docs, and ak99372/zkochan discussion read. No install, build or deployment executed.

Started from a post by @pnpm, packaged by the editor. Original post

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# pnpm: deploy one workspace package across versions
Summary: Check the pnpm version before enabling injection: current deployment supports linked workspace dependencies, while older implementations require injection or legacy mode. Export one package with `pnpm --filter=<deployed-project> --prod deploy <target-directory>`
Copy for agent
get the whatworks thread pnpm-deploy-workspace-injection-version-boundaries and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread pnpm-deploy-workspace-injection-version-boundaries
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks