Problem
I am encountering a problem which has already been raised in this site:
- Can't locate Algorithm/Diff.pm in @INC (you may need to install the Algorithm::Diff module)
- Can't locate Algorithm/Diff.pm in @INC (you may need to install the Algorithm::Diff module) - solution to earlier question does not work
Namely when I try to run latexdiff old.tex new.tex > diff.tex I am getting the following exception:
Can't locate Algorithm/Diff.pm in @INC (you may need to install the Algorithm::Diff module) (@INC entries checked:
C:/Users/<user_name>/AppData/Local/Programs/MiKTeX/scripts/latexdiff/
/usr/lib/perl5/site_perl
/usr/share/perl5/site_perl
/usr/lib/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib/perl5/core_perl
/usr/share/perl5/core_perl
) at C:/Users/<user_name>/AppData/Local/Programs/MiKTeX/scripts/latexdiff/latexdiff line 256.
BEGIN failed--compilation aborted at C:/Users/<user_name>/AppData/Local/Programs/MiKTeX/scripts/latexdiff/latexdiff line 256.
How can I fix this issue? Should I retry some of the below actions, but by modifying paths, etc.?
Solutions tried
No answers have been provided to the 2nd question. Re the first one, unfortunately the most upvoted answer does not work for me: when I try to run perl -MCPAN -e "install Algorithm::Diff" in bash, I am getting the following error:
Can't locate CPAN/Author.pm in @INC (you may need to install the CPAN::Author module) (@INC entries checked:
/usr/lib/perl5/site_perl
/usr/share/perl5/site_perl
/usr/lib/perl5/vendor_perl
/usr/share/perl5/vendor_perl
/usr/lib/perl5/core_perl
/usr/share/perl5/core_perl
) at /usr/share/perl5/core_perl/CPAN.pm line 19.
BEGIN failed--compilation aborted at /usr/share/perl5/core_perl/CPAN.pm line 19.
Compilation failed in require.
BEGIN failed--compilation aborted.
The second answer also does not work either as pacman is not recognized.
I have tried this answer which suggests adding environment variables PERL5LIB and PERLLIB but with no success. I have also found this other question but the indications given in the answers do not seem applicable to my case, or have not worked.
Additional information
When I run where perl in bash, I see the used installation comes from Git:
$ where perl
C:\Program Files\Git\usr\bin\perl.exe
I actually see the following structure in the Git installation:
Git\usr
|
|__bin\
| |__core_perl\
| |__vendor_perl\
| | ...
| |__perl.exe
|
|__lib\
| |__perl5\
| |__core_perl\
| |__vendor_perl\
|
|__share\
|__perl5\
|__core_perl\
|__vendor_perl\
pacmanis the package manager for Arch, so I would not expect it to work on Windows.whereis not a standardbashcommand. I don't know enough about Windows to infer from the output your setup. is this wsl or wsl2? or cygwin? have you tried installing the missing module?latexdiff-soworks so this is enough for my purpose.