question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Patch is not applied under windows (not a CRLF problem)

See original GitHub issue

It seems that the latest patch-package has issues working under windows (I did not check the other versions). My patch file has LF endings, the file in node_modules/ also does.

$ patch-package
patch-package: Applying patches...
**ERROR** Failed to apply patch for package jison-lex
...

Note that the patch applied successfully through

$ patch -p1 -i patches/jison-lex+0.3.4.patch
patching file node_modules/jison-lex/regexp-lexer.js

Maybe just use patch in your package? 😃 That patch that I am using is here: https://github.com/roman-spiridonov/sandbox/tree/master/[Stanford] Compilers/cool-jison.

P.S. I do not know how to create and apply the patch through git diff/git apply manually, because node_modules/ folder is in my global .gitignore. Note that patch is created just fine but I cannot apply that.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:13 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
ds300commented, Oct 31, 2017

Published in 3.6.0 🎉

0reactions
ds300commented, Oct 31, 2017

Great! I should have a permanent fix for this later tonight.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot patch file with CRLF line endings · Issue #1973 - GitHub
Unfortunately, the only way to patch a file with CRLF line endings seems to be using the --binary option with a CRLF patch...
Read more >
How to use patches created in windows (with CRLF) in linux?I
The Linux patch command will not recognize a patchfile that has CRLF in the patch 'meta-lines'. The line-endings of the actual patch content...
Read more >
CRLF line endings cause problems with "git apply" - Drupal
Problem /Motivation The template files (.tpl.php) that generate the ical feed have DOS-style (CRLF) line endings. This is a good thing.
Read more >
Patch does not apply when staging lines | Sourcetree For Mac
This problem can be resolved by changing the line endings back to LF. Similarly, the problem can be reproduced by converting a file...
Read more >
How to fix "Hunk #1 FAILED at 1 (different line endings ...
GNU patch does not have an option to tell it to transform a patch with LF endings into CRLF to apply to files...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found