Patch-package tries to apply the same patch twice and fails
See original GitHub issueI’ve set patch-package up according to the directions in the README, adding it as a prepare script in my package.json file, and I’ve added a single patch file. On a clean run with no node_modules, or with the patch not applied yet, the patch works great! However after the patch has been applied running yarn
again seems to try to apply the patch again which fails. Here’s some sample output:
[nix-shell:~/project]$ rm -rf node_modules/ && yarn
yarn install v1.0.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "ajv-keywords@2.1.0" has incorrect peer dependency "ajv@>=5.0.0".
[4/4] Building fresh packages...
warning Your current version of Yarn is out of date. The latest version is "1.3.2" while you're on "1.0.1".
info To upgrade, run the following command:
$ curl -o- -L https://yarnpkg.com/install.sh | bash
$ patch-package
patch-package: Applying patches...
@types/ramda@0.24.17 ✔
Done in 10.07s.
[nix-shell:~/project]$ yarn
yarn install v1.0.1
[1/4] Resolving packages...
success Already up-to-date.
$ patch-package
patch-package: Applying patches...
**ERROR** Failed to apply patch for package @types/ramda
This error was caused because Git cannot apply the following patch file:
patches/@types/ramda+0.24.17.patch
This is usually caused by inconsistent whitespace in the patch file.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
Issue Analytics
- State:
- Created 6 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Inconsistent information provided when patching fails · Issue #20
**ERROR** Failed to apply patch for package ... I'm patching a different package but I get the exact same result. ... Info: Patch...
Read more >How to handle the when patch is applied twice on the same ...
When applying the same patch twice, patch will report that and fail, which is what your code is trying to do. Am I...
Read more >Composer installation fails to apply patches on FreeBSD
There are no indications as to why, only that patches are not being applied, ... A second composer install gives the same result:...
Read more >How to install a patch (includes video demo)
When the download completes, double-click the executable to launch it on the server. Click Finish once you are prompted that the update completed...
Read more >2 Installation, Patching, and Configuration - Oracle Help Center
As long as vendor approved patches and/or packages are installed, the prerequisite warnings could be ignored and the installation completed.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ds300 All fixed! Thanks for the quick patch!
Fix released in 3.6.1. Thanks again for the report! ❤️