Open irudoy opened 4 years ago
I solved this by adding an entry packageExtensions to the yarn config file .yarnrc.yml
packageExtensions:
debug@*:
dependencies:
supports-color: "*"
Run yarn after changing the .yarnrc.yml file.
You can find more info on the .yarnrc.yml file here: https://yarnpkg.com/configuration/yarnrc#packageExtensions Essentially the packageExtensions of .yarnrc gives you a way to override the dependencies of packages. In this case the problem is that debug declares supports-color as a peer-dependency rather than a dependency.
If I understand this correctly, the authors of the debug
package actually intended to make supports-color
an optional peer dependency, so the correct override is:
packageExtensions:
"debug@*":
peerDependenciesMeta:
"supports-color":
optional: true
This exact example is listed in the Official Yarn 2 Migration Guide.
@atablash it's indeed listed in the official doc, but for some reason, it does not work. While Giorgio's solution works
Got those errors during webpack build, using yarn@berry: