New Override feature not working for nested peer dependencies? #552
-
With npm@8 came the ability to define overrides in our package.json which we use to override (i.e force) what version of a dependency our app or our app's dependencies use. i.e: // package.json
"overrides":{
"react": "17.0.2",
} The documentation for package.json's override implies that we can do this to override a specific dep's nested dep version. // package.json
"overrides":{
"some-old-dep":{
"react": "17.0.2",
}
} Unfortunately, the above does not work if nested dep i.e
It seems that from the documentation of the npm@8 "overrides" feature, this should be very possible. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 2 replies
-
Can you file this as an bug using our issue template here: https://github.com/npm/cli/issues/new?assignees=&labels=Bug%2CNeeds+Triage%2CRelease+8.x&template=bug_8.yml&title=%5BBUG%5D+%3Ctitle%3E |
Beta Was this translation helpful? Give feedback.
-
@iyobo Was the bug filed ? I recently face this issue with react-lottie package. My root project uses react^17.02 as dep, whereas react-lottie has peerDep to react at max ^16.0.0. Even I tried solution at https://docs.npmjs.com/cli/v8/configuring-npm/package-json#overrides mentioned in issue Below is the error
|
Beta Was this translation helpful? Give feedback.
-
I have the same issue. |
Beta Was this translation helpful? Give feedback.
-
@induratized do you have a monorepo with workspaces? If that's the case, then you need to put the overrides rules inside the root package.json otherwise the overrides are ignored, as mentioned here |
Beta Was this translation helpful? Give feedback.
Can you file this as an bug using our issue template here: https://github.com/npm/cli/issues/new?assignees=&labels=Bug%2CNeeds+Triage%2CRelease+8.x&template=bug_8.yml&title=%5BBUG%5D+%3Ctitle%3E