Patch file error => @usercentrics/[email protected]
Hello, when I try to create a patch for @usercentrics/[email protected], I get the following error =>
• Creating temporary folder • Installing @usercentrics/[email protected] with yarn
{ status: 1, signal: null, output: [ null, <Buffer 1b 5b 33 31 6d 1b 5b 31 6d 55 6e 6b 6e 6f 77 6e 20 53 79 6e 74 61 78 20 45 72 72 6f 72 1b 5b 32 32 6d 1b 5b 33 39 6d 3a 20 55 6e 73 75 70 70 6f 72 74 ... 185 more bytes>, <Buffer > ], pid: 31660, stdout: <Buffer 1b 5b 33 31 6d 1b 5b 31 6d 55 6e 6b 6e 6f 77 6e 20 53 79 6e 74 61 78 20 45 72 72 6f 72 1b 5b 32 32 6d 1b 5b 33 39 6d 3a 20 55 6e 73 75 70 70 6f 72 74 ... 185 more bytes>, stderr: <Buffer >, error: null }
/react-native-mobile-app/node_modules/patch-package/dist/makePatch.js:395 throw e; ^ { status: 1, signal: null, output: [ null, Buffer(235) [Uint8Array] [ 27, 91, 51, 49, 109, 27, 91, 49, 109, 85, 110, 107, 110, 111, 119, 110, 32, 83, 121, 110, 116, 97, 120, 32, 69, 114, 114, 111, 114, 27, 91, 50, 50, 109, 27, 91, 51, 57, 109, 58, 32, 85, 110, 115, 117, 112, 112, 111, 114, 116, 101, 100, 32, 111, 112, 116, 105, 111, 110, 32, 110, 97, 109, 101, 32, 40, 34, 45, 45, 105, 103, 110, 111, 114, 101, 45, 115, 99, 114, 105, 112, 116, 115, 34, 41, 46, 10, 10, 36, 32, 121, 97, 114, 110, 32, 105, 110, 115, 116, 97, ... 135 more items ], Buffer(0) [Uint8Array] [] ], pid: 31660, stdout: Buffer(235) [Uint8Array] [ 27, 91, 51, 49, 109, 27, 91, 49, 109, 85, 110, 107, 110, 111, 119, 110, 32, 83, 121, 110, 116, 97, 120, 32, 69, 114, 114, 111, 114, 27, 91, 50, 50, 109, 27, 91, 51, 57, 109, 58, 32, 85, 110, 115, 117, 112, 112, 111, 114, 116, 101, 100, 32, 111, 112, 116, 105, 111, 110, 32, 110, 97, 109, 101, 32, 40, 34, 45, 45, 105, 103, 110, 111, 114, 101, 45, 115, 99, 114, 105, 112, 116, 115, 34, 41, 46, 10, 10, 36, 32, 121, 97, 114, 110, 32, 105, 110, 115, 116, 97, ... 135 more items ], stderr: Buffer(0) [Uint8Array] [], error: null }
Node.js v18.19.0
Hi @BogdanRad I managed to do a workaround this issue. I had the same error as you, as I am using Yarn3, for my project, and patch-package is trying to use "--ignore-scripts" when installing with yarn, which doesn't work.
To fix the issue and create my patch, temporarily switched to installing packages with npm. My steps:
- Delete
node modules, - Delete
yarn.lock, - run
npm install --force(without force it was failing for some packages on my end.) - Make the changes you need in node modules, for the package you want to patch.
- run
npx patch-package package-with-the-issue(at this point the patch is created) - Remove
node modulesand removepackage-lock.json - run
yarn, to go back to youur original code.
thank you @iMonk777!
Thank you so much @iMonk777 for this. Been stuck with this issue for quite some time and this is all that I needed.