Search code examples
yarnpkgyarnpkg-v2yarnpkg-v3

Update previously patched package with Yarn Berry


I'm using Yarn@3.0.2 in my project.

I have patched a package (@pkg/pkg) with the command yarn patch @pkg/pkg and I am using it as a devDependency with the patch: protocol.

Now I need to make another patch to the same package - but when I run the same command I get Multiple candidate packages found [...].

It works when trying to target the original package (using yarn patch @pkg/pkg@x.x.x), but I can't seem to find a way to target the patched project.

Any skilled yarn developer out there?

(Possibly useful information: I cannot use the resolutions field for the patch since @pkg/pkg is a CLI which does not seem to work with this approach)


Solution

  • The solution was to choose the patch suggested with the error and encapsule it in qoutes such as:

    yarn patch "patch:..."