patch-package icon indicating copy to clipboard operation
patch-package copied to clipboard

Unhelpfull error

Open Evanion opened this issue 1 year ago • 7 comments

Hello I have tried in both pwsh and bash on windows 11 to create a patch, but I get a cryptic error that doesn't really give me any info on why it failed.

 npx patch-package @remix-run/dev
patch-package 8.0.0
• Creating temporary folder
• Installing @remix-run/[email protected] with npm
{
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 42836,
  stdout: null,
  stderr: null,
  error: null
}

C:\dev\LHB.Frontend\node_modules\patch-package\dist\makePatch.js:395
        throw e;
        ^
{
  status: 1,
  signal: null,
  output: [ null, null, null ],
  pid: 42836,
  stdout: null,
  stderr: null,
  error: null
}

Node.js v20.12.2

I have used the tool as late as last week in this repo, so I don't understand why this fails. Any ideas on how I can futher debug this?

Evanion avatar Jan 17 '25 15:01 Evanion

Same error

irodeanu avatar Jan 21 '25 08:01 irodeanu

👍

jeanparpaillon avatar Jan 24 '25 13:01 jeanparpaillon

Same here, started happening a week ago

carsonxw avatar Jan 25 '25 04:01 carsonxw

This is an artifact of using new yarn versions while patch-package doesn't support for them for patch-generation.

There are PRs that will fix this, however you need it to work now right? I did.

~So patch-package can patch just fine with new yarn versions but it cannot generate patches with new yarn versions.~

~Solution: use npm just for patch generation, add the --use-npm flag at the end~

~npx patch-package <broken package name here> --use-npm~

Edit: I swear that worked one time, but it did not work a second time.

But what did work was temporarily doing a yarn set version 1.22.20 then npx patch-package <busted package> and then reverting the yarn version change 🤷

mikehardy avatar Feb 03 '25 22:02 mikehardy

This is an artifact of using new yarn versions while patch-package doesn't support for them for patch-generation.

I'm using regular NPM

Evanion avatar Apr 09 '25 06:04 Evanion

After trying a bunch of stuff, using an older yarn worked. Thanks @mikehardy

oidoug avatar May 27 '25 16:05 oidoug

But what did work was temporarily doing a yarn set version 1.22.20 then npx patch-package <busted package> and then reverting the yarn version change 🤷

For me, this only worked when I ran it using yarn rather than npx. For anyone else having this issue when it gets to Installing package@version with yarn, this might be an issue with it attempting to use a different version of yarn installed somewhere else on the system or there is a loss of context and it ends up using the wrong version.

Running yarn patch-package <package-name> on yarn 1.22.20 worked for me.

ZandercraftGames avatar Nov 12 '25 16:11 ZandercraftGames