Faelin has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks! First timer here, so I apologize if I phrase my inquiry poorly... In any case, I am having difficulty with the cpanm utility along with perlbrew, on Mac OS X 10.14. Specifically, when I try to install modules using cpanm (installed through perlbrew), I get a listing of the prerequisites that are missing, but the cpanm system won't automatically install them! Instead, I have to manually cpanm each one of them (and if they have their own prereqs, then I have to recursively expand my cpanm module downloading) until the originally attempted module finally installs! And I'm not sure what to do about this! I have tried removing cpanm and reinstalling, I have tried installing cpanm using $ cpan App::cpanminus, I have tried to remove and recreate the cpan config... nothing works! The modules do eventually get installed per the method described above, but on other systems where I've used cpanm, it seems that prereqs are automatically chased down. I've also made sure that the relevant PERL_CPANM_OPT environment variable is empty, as well. By way of example, running $ cpanm Moose results in the following:
--> Working on Moose Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Moose-2.2011.tar.gz + ... OK Configuring Moose-2.2011 ... OK ==> Found dependencies: Test::CleanNamespaces, Sub::Exporter, Devel::O +verloadInfo, Class::Load::XS, Data::OptList, Module::Runtime::Conflic +ts, Package::DeprecationManager, Class::Load, Package::Stash --> Working on Test::CleanNamespaces Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Test-CleanNamespace +s-0.23.tar.gz ... OK Configuring Test-CleanNamespaces-0.23 ... OK ==> Found dependencies: Sub::Exporter, Package::Stash, namespace::clea +n --> Working on Sub::Exporter Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Sub-Exporter-0.987.t +ar.gz ... OK Configuring Sub-Exporter-0.987 ... OK ==> Found dependencies: Data::OptList --> Working on Data::OptList Fetching http://www.cpan.org/authors/id/R/RJ/RJBS/Data-OptList-0.110.t +ar.gz ... OK Configuring Data-OptList-0.110 ... OK Building and testing Data-OptList-0.110 ... FAIL ! Installing Data::OptList failed. See /Users/faelin/.cpanm/work/15430 +83528.5667/build.log for details. Retry with --force to force install + it. ! Installing the dependencies failed: Module 'Data::OptList' is not in +stalled ! Bailing out the installation for Sub-Exporter-0.987. --> Working on Package::Stash Fetching http://www.cpan.org/authors/id/D/DO/DOY/Package-Stash-0.37.ta +r.gz ... OK Configuring Package-Stash-0.37 ... OK Building and testing Package-Stash-0.37 ... FAIL ! Installing Package::Stash failed. See /Users/faelin/.cpanm/work/1543 +083528.5667/build.log for details. Retry with --force to force instal +l it. --> Working on namespace::clean Fetching http://www.cpan.org/authors/id/R/RI/RIBASUSHI/namespace-clean +-0.27.tar.gz ... OK Configuring namespace-clean-0.27 ... OK ==> Found dependencies: Package::Stash ! Installing the dependencies failed: Module 'Package::Stash' is not i +nstalled ! Bailing out the installation for namespace-clean-0.27. ! Installing the dependencies failed: Module 'Sub::Exporter' is not in +stalled, Module 'Package::Stash' is not installed, Module 'namespace: +:clean' is not installed ! Bailing out the installation for Test-CleanNamespaces-0.23. --> Working on Devel::OverloadInfo Fetching http://www.cpan.org/authors/id/I/IL/ILMARI/Devel-OverloadInfo +-0.005.tar.gz ... OK Configuring Devel-OverloadInfo-0.005 ... OK ==> Found dependencies: Package::Stash ! Installing the dependencies failed: Module 'Package::Stash' is not i +nstalled ! Bailing out the installation for Devel-OverloadInfo-0.005. --> Working on Class::Load::XS Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Class-Load-XS-0.10. +tar.gz ... OK Configuring Class-Load-XS-0.10 ... OK ==> Found dependencies: Class::Load --> Working on Class::Load Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Class-Load-0.25.tar +.gz ... OK Configuring Class-Load-0.25 ... OK ==> Found dependencies: Package::Stash, Data::OptList ! Installing the dependencies failed: Module 'Package::Stash' is not i +nstalled, Module 'Data::OptList' is not installed ! Bailing out the installation for Class-Load-0.25. ! Installing the dependencies failed: Module 'Class::Load' is not inst +alled ! Bailing out the installation for Class-Load-XS-0.10. --> Working on Module::Runtime::Conflicts Fetching http://www.cpan.org/authors/id/E/ET/ETHER/Module-Runtime-Conf +licts-0.003.tar.gz ... OK Configuring Module-Runtime-Conflicts-0.003 ... OK Building and testing Module-Runtime-Conflicts-0.003 ... FAIL ! Installing Module::Runtime::Conflicts failed. See /Users/faelin/.cpa +nm/work/1543083528.5667/build.log for details. Retry with --force to +force install it. --> Working on Package::DeprecationManager Fetching http://www.cpan.org/authors/id/D/DR/DROLSKY/Package-Deprecati +onManager-0.17.tar.gz ... OK Configuring Package-DeprecationManager-0.17 ... OK ==> Found dependencies: Package::Stash ! Installing the dependencies failed: Module 'Package::Stash' is not i +nstalled ! Bailing out the installation for Package-DeprecationManager-0.17. ! Installing the dependencies failed: Module 'Test::CleanNamespaces' i +s not installed, Module 'Sub::Exporter' is not installed, Module 'Dev +el::OverloadInfo' is not installed, Module 'Class::Load::XS' is not i +nstalled, Module 'Data::OptList' is not installed, Module 'Module::Ru +ntime::Conflicts' is not installed, Module 'Package::DeprecationManag +er' is not installed, Module 'Class::Load' is not installed, Module ' +Package::Stash' is not installed ! Bailing out the installation for Moose-2.2011.

Replies are listed 'Best First'.
Re: cpanm prerequisites won't install automatically
by 1nickt (Canon) on Nov 24, 2018 at 19:11 UTC

    Hi, did you run ~/perl5/perlbrew/bin/install-cpanm as shown in the Perlbrew documentation?

    Hope this helps!


    The way forward always starts with a minimal test.
Re: cpanm prerequisites won't install automatically
by syphilis (Archbishop) on Nov 24, 2018 at 23:21 UTC
    I get a listing of the prerequisites that are missing, but the cpanm system won't automatically install them!

    Looks to me that it's chasing down the dependencies and trying to install them - but some of the modules are failing to install.
    First failure is for Data::OptList, for which we're told:
    ! Installing Data::OptList failed. See /Users/faelin/.cpanm/work/15430 +83528.5667/build.log for details. Retry with --force to force install + it.
    I'd recommend having a look at that build.log to see what the problem was. If it's a test failure (and one that doesn't bother you), by all means take the advice of adding --force to the cpanm command that you're running, and see how that goes.

    It would be best to show us what's in that build.log if you're unsure on how to proceed.

    Cheers,
    Rob
Re: cpanm prerequisites won't install automatically
by Your Mother (Archbishop) on Nov 25, 2018 at 16:32 UTC

    Since there is no follow-up about a resolution, I’m chiming in. I hit these (usually circular dependency) cases now and then (quite often with DROLSKY’s releases involved, as here) and have been able to fix it every time by installing, in isolation, a module or two it complains about before going back to the original target.