You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't have a repo to point to, but in my case I'm using [email protected] as installer, I have some transitive dependencies in node_modules, e.g. vfile is in my node_modules but it's not in my package.json. I have a patches/vfile:1.4.0.patch file, and the version installed is also v1.4.0.
Expected:patch-package to patch a package without errors
Actual:
click here
***ERROR***
patch-package requires yarn as a local peer-dependency
Applying patches to node_modules...
[email protected] ✔
[email protected] ✔
**ERROR** Failed to apply patch for package vfile
Patch was made for version 1.4.0
Meanwhile node_modules/vfile is version 1.4.0
Run:
patch --forward -p1 -i patches/vfile:1.4.0.patch
To generate rejection files and see just what the heck happened.
I also got the rejection files, but it doesn't explain anything new:
patching file node_modules/vfile/index.js
patch unexpectedly ends in middle of line
Hunk #1 FAILED at 43.
1 out of 1 hunk FAILED -- saving rejects to file node_modules/vfile/index.js.rej
Can you post the contents of the patch file and note whether it ends in a linefeed? Also, try adding a linefeed to the end of the file and see if the patch can be applied.
Yes, that seemed to be the issue. Thanks!
I forgot to mention I manually edited the patch files because the nested dependency differed in its package.json contents (as usually, the package.json of an installed dependency is kind of... messed up) and I messed up with the linefeed at the end of the file.
patch-package version: v2.0.0
Reproduction:
I don't have a repo to point to, but in my case I'm using
[email protected]
as installer, I have some transitive dependencies in node_modules, e.g.vfile
is in my node_modules but it's not in my package.json. I have apatches/vfile:1.4.0.patch
file, and the version installed is also v1.4.0.Expected:
patch-package
to patch a package without errorsActual:
click here
I also got the rejection files, but it doesn't explain anything new:
index.js.rej
index.js.orig
The text was updated successfully, but these errors were encountered: