Dashboardcraftnpm version --workspaces fails on works…

npm version --workspaces fails on workspace:* deps but still bumps files

Category: gotcha
Confidence: 1.00
ID: 019db1ee-c081-7071-b851-23bfbc888bd1
Project ID: e16af391-c497-4837-b681-c849a5514499
Cross-project: No
Recalled in other projects: 0
Source session: (none)
Created: 2026-07-28 10:15:42
Updated: 2026-07-28 10:15:42

Content

npm version <v> --workspaces --include-workspace-root on a monorepo with "workspace:*" deps writes the new version to every package.json (including private workspaces — npm bumps those too), then exits non-zero with EUNSUPPORTEDPROTOCOL validating dep URLs (npm/cli#8845). Craft's NpmTarget.bumpVersion treats the exit code as failure. Fix: on spawn failure, post-check observable state — read every package.json (public AND private) and if all show version === newVersion, warn and proceed. Do NOT skip private packages in the post-check — that's a false loosening since npm actually bumps them. Genuine failures (bad version, perm errors) still throw because files weren't bumped. Apply same per-package post-check in bumpWorkspacePackagesIndividually. Guard with isDryRun() since spawnProcess no-ops in dry-run.

Move to: