Unhelpfull error
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?
Same error
👍
Same here, started happening a week ago
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 🤷
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
After trying a bunch of stuff, using an older yarn worked. Thanks @mikehardy
But what did work was temporarily doing a
yarn set version 1.22.20thennpx 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.