2

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)

Machavity
  • 30,841
  • 27
  • 92
  • 100
SchlagerKhan
  • 61
  • 1
  • 6

1 Answers1

2

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

yarn patch "patch:..."

SchlagerKhan
  • 61
  • 1
  • 6
  • I am getting "No package found in the project for the given locator". Just copied patch string from resolutions in package.json... – acidernt Jan 13 '23 at 19:54