Ben
Ben

Reputation: 133

How to fix Perl CPAN module error: version 0.82 required, this is only version 0.78?

Whether I use CPAN or install manually, every time I try to run "perl Makefile.PL" to build a makefile for a Perl module, I get the following error:

ERROR from evaluation of Makefile.PL: Can't locate object method "new" via package "CPAN::Meta" at /usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm line 1199

The CPAN::Meta module is installed, so I'm completely stumped on this one.

When run: perl -MCPAN::Meta -e1 it returns me the error:

version 0.82 required--this is only version 0.78 at /usr/lib/perl5/5.8.8/CPAN/Meta/Converter.pm line 12.

Upvotes: 2

Views: 6544

Answers (5)

El_Tel
El_Tel

Reputation: 41

The up to date 'version' is here: https://metacpan.org/pod/version

ExtUtils::MakeMaker contains a stripped down version which says:

This is a modified copy of version.pm 0.9909, bundled exclusively for use by ExtUtils::Makemaker and its dependencies to bootstrap when version.pm is not available.

But in the code it says: $VERSION = '7.36';

Upvotes: 0

kenorb
kenorb

Reputation: 166795

If you've the error (as per comment about perl -MCPAN::Meta -e1):

version version 0.82 required--this is only version 0.78

then try upgrading it:

cpan CPAN::Meta

If you don't have access to install perl packages globally, run cpan and execute:

cpan> look CPAN::Meta

which will open a subshell in a distribution's directory, so you can download CPAN tar.gz manually and extract it there.

Source: Issues with installing Inline::Python

Upvotes: 0

Cosmicnet
Cosmicnet

Reputation: 459

I just had this same problem, here is a solution with description:

I was doing a "cpan Bundle::CPAN" which failed. When I re-ran I found that cpan was now broken and I couldn't install any modules. Worst still, "perl Makefile.PL" was also dying with the same error:

Can't locate object method "new" via package "CPAN::Meta" at /usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm line XXXX

When testing the CPAN::Meta module directly, I found the Parse::CPAN::Meta version was too old:
perl -MCPAN::Meta
Parse::CPAN::Meta version 1.44 required--this is only version 1.40 at /usr/lib/perl5/5.8.8/CPAN/Meta/Converter.pm line 13.

To be able to update Parse::CPAN::Meta, I had to first disable the use of CPAN::Meta in MakeMaker. I edited the file:
/usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm
And added "return 0;" after "sub _has_cpan_meta {" to make:
sub _has_cpan_meta {
return 0;

Then I was able to install Parse::CPAN::Meta as normal with "cpan Parse::CPAN::Meta". After which I confirmed CPAN::Meta was working "perl -MCPAN::Meta" and removed the "return 0" I'd added to /usr/lib/perl5/5.8.8/ExtUtils/MM_Any.pm.

Hey presto, all working again :)

Hope that helps anyone else who finds this thread.

Upvotes: 0

Alexandr Ciornii
Alexandr Ciornii

Reputation: 7392

It seems that when installing ExtUtils::MakeMaker, version.pm (which is bundled inside EU::MM) was not upgraded. You need to upgrade it manually. root is required for this if you don't use local::lib.

Upvotes: 1

stevecomrie
stevecomrie

Reputation: 2483

Try finding the location of CPAN::Meta and delete it or back it up and then try installing it again.

Upvotes: -1

Related Questions