I will try to illustrate my problem in simple terms.
I want to install two plugins, plugin A in version 2.0 and plugin B in version 3.0 . plugin B has plugin A as a sub-dependency with a different version, and that version breaks the build phase of my react application.
Package A@2.0.0
Package B@2.0.0 ---> Package A @3.0.0 (one of the sub-dependencies)
My question is how do I force plugin B to install plugin A with the specified version, or not install it altogether?
Here's my package.json
//my package.json
{
"package A": "2.0.0",
"package B": "2.0.0",
"overrides": {
"package B": {
"package A": "2.0.0" //I try to force version 2 but it doesn't work
}
}
Some things I tried or noticed: Overrides doesn't seem to work on nested dependencies, maybe it works when you try to upgrade, or it's just not possible with the specific package I needed.
Found the answer, I'm using yarn and all I had to do is put "resolutions" instead of "overrides" Now my package json looks like this
//my package.json
{
"package A": "2.0.0",
"package B": "2.0.0",
"resolutions": {
"package A": "2.0.0"
}
}