Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl CPAN Can't locate CPAN/Author.pm... when trying to install nipe

Tags:

config

perl

cpan

I'm trying to install "nipe" on my Windows Machine but i get this error code all the time. I have installed Strawberry Perl.

This is the error code:

Can't locate CPAN/Author.pm in @INC (you may need to install the CPAN::Author module) (@INC contains: /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 at /usr/share/perl5/core_perl/App/Cpan.pm line 290.
BEGIN failed--compilation aborted at /usr/share/perl5/core_perl/App/Cpan.pm line 290.
Compilation failed in require at /c/Strawberry/perl/bin/cpan line 7.
BEGIN failed--compilation aborted at /c/Strawberry/perl/bin/cpan line 7.
like image 728
Hellasguys1212 Avatar asked Jul 17 '20 18:07

Hellasguys1212


2 Answers

While you may have Strawberry Perl installed, that's not the perl you are using. C:\Strawberry\perl\bin\cpan uses the first perl in your PATH, which isn't your installation of Strawberry Perl. It appears that you are using some unix emulation (Cygwin? MSYS?) and using the perl from that emulation.

To use your Strawberry Perl build of perl, you could adjust your PATH so that SP comes before whatever perl you ended up using, or you could use

C:\Strawberry\perl\bin\perl C:\Strawberry\perl\bin\cpan Try::Tiny Config::Simple JSON

or

C:\Strawberry\perl\bin\perl -MCPAN -e"install @ARGV" Try::Tiny Config::Simple JSON

in lieu of

cpan Try::Tiny Config::Simple JSON

Similarly, if you don't adjust your path, you'll need to use

C:\Strawberry\perl\bin\perl nipe.pl ...

in lieu of

perl nipe.pl ...
like image 127
ikegami Avatar answered Sep 19 '22 12:09

ikegami


If your are using windows and a bash then try to it with cmd or powershell after you applied the changes from @ikegami. Took me some time to figure out, that it had no effect to change the paths for this terminal, as it still took the paths from /usr//perl5/

like image 24
Ranarox Avatar answered Sep 20 '22 12:09

Ranarox