I tried to compile a pdf in rmarkdon but the error shows hyperref-langpatches.def file not found. However, I can generate the pdf using the .tex file generated during the process.
I just had the exact same error message while knitting an RMarkdown document.
tinytex::reinstall_tinytex() in the R Console solved the problem for me. It is recommended in the troubleshooting page of the R package
I hope it works for you too!