miyagawa / cpanminus

cpanminus - get, unpack, build and install modules from CPAN
http://cpanmin.us
752 stars 213 forks source link

Problems while installing `cpm` #642

Closed KES777 closed 2 years ago

KES777 commented 2 years ago

This is more question but probably could be a bug.
We see that Successfully installed Parse-PMFile-0.43 (upgraded from 0.42)
But then installation failed because Installing the dependencies failed: Installed version (0.42) of Parse::PMFile is not in range '0.43'

So why cpanm complains about wrong version for Parse::PMFile when it just upgrades is to required 0.43?

$ cpanm App::cpm
--> Working on App::cpm
Fetching http://www.cpan.org/authors/id/S/SK/SKAJI/App-cpm-0.997011.tar.gz ... OK
Configuring App-cpm-0.997011 ... OK
==> Found dependencies: Command::Runner, Parallel::Pipes::App, Module::cpmfile, Parse::PMFile, CPAN::02Packages::Search, ExtUtils::Install
--> Working on Command::Runner
Fetching http://www.cpan.org/authors/id/S/SK/SKAJI/Command-Runner-0.200.tar.gz ... OK
Configuring Command-Runner-0.200 ... OK
Building and testing Command-Runner-0.200 ... OK
Successfully installed Command-Runner-0.200
--> Working on Parallel::Pipes::App
Fetching http://www.cpan.org/authors/id/S/SK/SKAJI/Parallel-Pipes-0.102.tar.gz ... OK
Configuring Parallel-Pipes-0.102 ... OK
Building and testing Parallel-Pipes-0.102 ... OK
Successfully installed Parallel-Pipes-0.102
--> Working on Module::cpmfile
Fetching http://www.cpan.org/authors/id/S/SK/SKAJI/Module-cpmfile-0.006.tar.gz ... OK
Configuring Module-cpmfile-0.006 ... OK
==> Found dependencies: YAML::PP
--> Working on YAML::PP
Fetching http://www.cpan.org/authors/id/T/TI/TINITA/YAML-PP-0.032.tar.gz ... OK
Configuring YAML-PP-0.032 ... OK
Building and testing YAML-PP-0.032 ... OK
Successfully installed YAML-PP-0.032
Building and testing Module-cpmfile-0.006 ... OK
Successfully installed Module-cpmfile-0.006
--> Working on Parse::PMFile
Fetching http://www.cpan.org/authors/id/I/IS/ISHIGAKI/Parse-PMFile-0.43.tar.gz ... OK
Configuring Parse-PMFile-0.43 ... OK
Building and testing Parse-PMFile-0.43 ... OK
Successfully installed Parse-PMFile-0.43 (upgraded from 0.42)
--> Working on CPAN::02Packages::Search
Fetching http://www.cpan.org/authors/id/S/SK/SKAJI/CPAN-02Packages-Search-0.001.tar.gz ... OK
Configuring CPAN-02Packages-Search-0.001 ... OK
Building and testing CPAN-02Packages-Search-0.001 ... OK
Successfully installed CPAN-02Packages-Search-0.001
--> Working on ExtUtils::Install
Fetching http://www.cpan.org/authors/id/B/BI/BINGOS/ExtUtils-Install-2.20.tar.gz ... OK
Configuring ExtUtils-Install-2.20 ... OK
Building and testing ExtUtils-Install-2.20 ... OK
Successfully installed ExtUtils-Install-2.20 (upgraded from 2.14)
! Installing the dependencies failed: Installed version (0.42) of Parse::PMFile is not in range '0.43'
! Bailing out the installation for App-cpm-0.997011.
7 distributions installed
KES777 commented 2 years ago
$ cpanm App::cpm
--> Working on App::cpm
Fetching http://www.cpan.org/authors/id/S/SK/SKAJI/App-cpm-0.997011.tar.gz ... OK
Configuring App-cpm-0.997011 ... OK
==> Found dependencies: Parse::PMFile
--> Working on Parse::PMFile
Fetching http://www.cpan.org/authors/id/I/IS/ISHIGAKI/Parse-PMFile-0.43.tar.gz ... OK
Configuring Parse-PMFile-0.43 ... OK
Building and testing Parse-PMFile-0.43 ... OK
Successfully installed Parse-PMFile-0.43 (upgraded from 0.42)
! Installing the dependencies failed: Installed version (0.42) of Parse::PMFile is not in range '0.43'
! Bailing out the installation for App-cpm-0.997011.
1 distribution installed
KES777 commented 2 years ago
$ perl -V
...
  @INC:
    /home/kes/work/projects/proj/lib
    /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/site_perl/5.30.3/x86_64-linux
    /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/site_perl/5.30.3
    /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3/x86_64-linux
    /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3

Just checked. at /home/kes/work/projects/proj/lib I have installed Parse-PMFile-0.42, but new version is installed into /home/kes/perl5/perlbrew/perls/perl-5.30.3/lib/5.30.3.
Thus I get that error.

Should cpanm clear @INC before installing?

miyagawa commented 2 years ago

You have PERL5LIB set to your proj/lib, but you don't have your shell configured to install modules there, causing the conflicts. cpanm doesn't touch your perl5 include path unless it's told to via -L.