yarn-deduplicate icon indicating copy to clipboard operation
yarn-deduplicate copied to clipboard

Auto install after `yarn.lock` changed via `yarn-deduplicate` util it is stable

Open JounQin opened this issue 2 years ago • 4 comments

As title.

JounQin avatar Aug 31 '22 21:08 JounQin

and what does the title mean? make example to explain it better.

glensc avatar Sep 22 '22 11:09 glensc

@glensc

I'm sorry for the confusion, it's a feature request.

I'm using prepare script in package.json with yarn-deduplicate --strategy fewer, and the result could sometimes be unstable, and I have to run yarn install several times to get a stable yarn.lock file.

JounQin avatar Sep 22 '22 11:09 JounQin

the result could sometimes be unstable

What do you mean by "unstable"?

I have to run yarn install several times

That sounds like a bug. It is expected you have to run yarn install once after yarn-deduplicate to prune orphan packages (can't be done safely with an external tool, see this issue). I'll make it explicit in the docs.

However, if you need to run yarn install more than once, that's very unexpected. Could you provide more details?

scinos avatar Sep 24 '22 05:09 scinos

I think that's because I'm using fewer strategy. I'm on a phone, so I can't explain in details. For short, different dependencies a maybe result different dependencies b, with first run a(or b) get stable versions, but the another one could be deduplicated again, so a second run is needed.

JounQin avatar Sep 24 '22 06:09 JounQin