Lerna: Lerna version bumps up the version of the the packages inside the repo

Created on 3 Dec 2019  路  3Comments  路  Source: lerna/lerna

Hi,

I am using the simplest lerna.json file:

{
  "npmClient": "npm",
  "packages": ["packages/*"],
  "version": "independent"
}

When I run lerna version it bumps up the version of all the packages in my repo.

Expected Behavior

If I make changes in 1 package, it should bump up just that.

Current Behavior

It prompts me to choose version for all the packages in the repo.

Steps to Reproduce (for bugs)

lerna version

Your Environment

| Executable | Version |
| ---: | :--- |
| lerna --version | 3.19.0 |
| npm --version | 6.13.1 |
| node --version | v12.11.1 |

| OS | Version |
| --- | --- |
| macOS Mojave | 10.14.6 |

Most helpful comment

I can't read minds, so unless there's a reproduction (or repo) I can look at, I can't tell you why that's happening.

Some _possible_ reasons:

  1. You don't have _any_ annotated release tags in your repo yet, and this is expected behavior.
  2. Your annotated release tags are being mangled by destructive merges or publishing on feature branches. Thus Lerna does not find any annotated release tags, and assumes everything needs to be published.
  3. The changed package is in fact a dependent of all other packages in the repo, and this behavior is expected (#707, etc, etc, etc). That is, all local dependents are automatically bumped when a local dependency changes, reflecting the automatic change to their dependency range.
  4. Spooky ghosts.

As a reminder, "independent" versioning is simply the ability to choose different versions on a package-by-package basis. It does not alter the fundamental change detection algorithm that Lerna uses, and by no means guarantees that a "single" changed package will yield _only_ one versioned package when you run lerna version.

All 3 comments

any update on this issue?

I can't read minds, so unless there's a reproduction (or repo) I can look at, I can't tell you why that's happening.

Some _possible_ reasons:

  1. You don't have _any_ annotated release tags in your repo yet, and this is expected behavior.
  2. Your annotated release tags are being mangled by destructive merges or publishing on feature branches. Thus Lerna does not find any annotated release tags, and assumes everything needs to be published.
  3. The changed package is in fact a dependent of all other packages in the repo, and this behavior is expected (#707, etc, etc, etc). That is, all local dependents are automatically bumped when a local dependency changes, reflecting the automatic change to their dependency range.
  4. Spooky ghosts.

As a reminder, "independent" versioning is simply the ability to choose different versions on a package-by-package basis. It does not alter the fundamental change detection algorithm that Lerna uses, and by no means guarantees that a "single" changed package will yield _only_ one versioned package when you run lerna version.

@Donato-EF if you're anything like me, it's because it was your first time really trying to use Lerna, and you haven't run lerna version on this repo before. Just pick something. The next time you try this, it'll work like you think.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nomcopter picture nomcopter  路  3Comments

rheaditi picture rheaditi  路  3Comments

lazd picture lazd  路  3Comments

kirill-konshin picture kirill-konshin  路  3Comments

dylang picture dylang  路  3Comments