Why do resolutions get removed from package.json after running yarn install?
Asked Answered
O

1

8

After upgrading to yarn 3, when I run yarn install, the resolutions are getting removed from package.json and added in yarn.lock file.

Are resolutions not supposed to reside in package.json when using yarn 3?

Obligee answered 20/7, 2022 at 10:50 Comment(2)
I'm also finding that yarn 3 is automatically removing resolutions for nested packages. E.g. x/**/y: 1.0.0Tory
It appears the glob syntax ** isn't/wasn't supported. Following the docs, Yarn is happy if removing the globs - which is arguably better, be it annoying if the dependencies are highly nested.Phia
Z
2

You need to use yarn set resolution with the newer versions of yarn: https://yarnpkg.com/cli/set/resolution

Warning! To persist the changes, use the -s flag or you'll lose the custom resolution when you regenerate your yarn.lock file.

Zacynthus answered 26/10, 2022 at 15:13 Comment(1)
-s is not implemented (yet). See github.com/yarnpkg/berry/issues/2202Efficacious

© 2022 - 2024 — McMap. All rights reserved.