Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lerna version doesn't update package-lock correctly #3090

Closed
reediculous456 opened this issue Mar 11, 2022 · 2 comments
Closed

lerna version doesn't update package-lock correctly #3090

reediculous456 opened this issue Mar 11, 2022 · 2 comments

Comments

@reediculous456
Copy link

When running npm version in npm > 7 there are 3 places to change the version now instead of the 2 in npm < 7 (this is related to lockfile v2) and lerna version only hits 2 of them

Expected Behavior

Run lerna version and the package.json version property gets updated, the package-lock.json version property gets updated, and the package-lock.json "packages".""."version" gets updated

Current Behavior

Only the package.json version property and the package-lock.json version property gets updated

Possible Solution

Use the --no-commit-hooks and --no-git-tag-version in conjunction with npm version to set the version for each package or adjust the existing version script to set the 3rd version property

Steps to Reproduce (for bugs)

  1. create a lerna repo with 1 package using npm 7+
  2. run lerna version to upgrade (any upgrade, doesn't matter)
  3. check the package-lock file to see the 3rd version identifier not updated
lerna.json

{
  "packages": [
    "packages/*"
  ],
  "version": "1.1.4"
}

Context

I have to go in and update this 3rd version prop after each version and then manually delete and re-create the version tag

Your Environment

Executable Version
lerna --version 4.0.0
npm --version 8.1.0
node --version 16.13.0
OS Version
macOS Monterey 12.1
@donmahallem
Copy link

There are several open issus #2832 and pull requests that don't get merged fixing this issue. None are handled by maintainers

@JamesHenry
Copy link
Member

Hi Folks 👋

You may or may not know that lerna is now under the stewardship of Nrwl (announcement here #3121), a company with a long history of not just producing valuable open-source software (OSS), but also backing others (at the time of writing, Nrwl has donated over $50,000 to OSS it hasn't created, see https://opencollective.com/nx for full details).

Quite simply, Nrwl ❤️ OSS, and is committed to making lerna the best it can be. We use it ourselves.

We hope you will continue to be a part of this community as we look to take things forward from here!

Please see #3140 for more details on our plans for 2022.

In the case of this specific issue, I'm please to say that a fix for it was just merged in #3091 and will go out in the next release of lerna.

Many thanks 🙏

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

No branches or pull requests

3 participants