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 add --scope
does not update package-lock file
#1989
Comments
My team's also missing this. We might be able to take a stab at a PR at some point, but until then, I just created these patches with patch-package:
|
That patch looks like a great start on the PR. :) |
Fix published in v3.14.0 |
Based on my current understanding, I agree the problem was most likely introduced by 71174e4. Possibly related: #2104 If/when my pull request lands, then it may be possible to solve the problem reported in this issue by adding
Honestly, I feel it was a mistake to land 71174e4 and change behavior of so many unintended places. I would prefer if the new behavior introduced by 71174e4 would require a new CLI flag to be enabled, and not the other way around. |
@bajtos Shouldn't this issue be reopened? I just encountered this issue with |
I'm getting this too with |
Same here with |
Same here with lerna@3.22.1. Using npm |
When adding a new dependency to a single package using
lerna add --scope {name} {dep}
, the filepackages/{name}/package-lock.json
is not updated.Strangely enough, when adding the same dependency to all packages (omitting
--scope
argument), package locks are updated correctly.Expected Behavior
When npm's package-lock feature is enabled, then
lerna add
should always update correspondingpackage-lock.json
files, regardless of whether--scope
argument was used or not.Current Behavior
lerna add --scope {name} {dep}
does not updatepackages/name/package-lock.json
file.Possible Solution
The same solution that's already in place for
lerna add
with no scope?Steps to Reproduce (for bugs)
Create a simple monorepo. I created a sandbox you can use yourself:
https://github.com/bajtos/lerna-package-locks/tree/lerna-add
Run the following command:
Run
git status
to see what has changed:lerna.json
Context
I ran into this issue after we have recently enabled package-lock feature in https://github.com/strongloop/loopback-next and found out that we don't know how correctly add new dependencies to our packages.
Your Environment
lerna --version
npm --version
yarn --version
node --version
Please note my global npm config in
~/.npmrc
is disabling the package-lock feature. The sandbox in https://github.com/bajtos/lerna-package-locks/tree/lerna-add is explicitly enabling it by including.npmrc
files in all places where it's needed.The text was updated successfully, but these errors were encountered: