Lerna Independent Versioning Bumped the Wrong Packages in CI
With "version": "independent", Lerna versions each package on its own based on what changed. In CI it can bump more packages than intended when conventional-commit detection, a wide change diff, or a forced flag pulls in packages you did not mean to release.
What this error means
A release job bumps and tags packages that had no meaningful change, or bumps the wrong semver level. The set differs from what you expected given the diff. Deterministic for the same commits and config.
lerna info version independent
lerna info Bumping: @acme/ui 1.4.0 => 2.0.0 # expected a patch
@acme/config 1.0.1 => 1.0.2 # unchanged, but force-bumpedCommon causes
Conventional-commit detection over-broad
With --conventional-commits, a commit touching shared files or an over-broad scope can mark unrelated packages as changed.
Forced version flag
--force-publish (or --force-publish=*) bumps every package regardless of changes, which is rarely what an independent release wants.
Wide change detection from a bad base
Lerna diffs against the last tag; a shallow clone or wrong base makes nearly everything look changed.
How to fix it
Scope the version run precisely
Avoid force-publishing everything; let change detection drive bumps from a correct base.
# lerna.json
{ "version": "independent" }
# release
npx lerna version --conventional-commits --no-push # review before taggingFix the change-detection base
- Use
fetch-depth: 0so Lerna diffs against the real last tag. - Drop
--force-publishunless you truly intend to bump every package. - Use
--no-pushfirst and inspect the planned bumps before tagging.
How to prevent it
- Avoid
--force-publish=*with independent versioning unless intended. - Use full history so change detection diffs against the correct tag.
- Review the planned bumps (
--no-push) before pushing tags in CI.