miyagawa / cpanminus

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

Using --uninstall broke cpanm? #620

Closed chexmix closed 3 years ago

chexmix commented 3 years ago

I am trying to set up a Perl environment for work -- am using perlbrew and have set the active Perl to 5.32.0. cpanm is installed and has been working flawlessly up to now.

I figured out I needed an older version of the URI module for some specific code to run without dying, so I used cpanm --uninstall to remove URI v. 5.05 (which is the current version of the module).

Since doing so, whenever I invoke cpanm to download / install a module, I now get this:

bash-4.2$ cpanm Astro::MoonPhase
Can't locate object method "new" via package "URI" at /home/my_machine/perl5/perlbrew/perls/perl-5.32.0/lib/site_perl/5.32.0/HTTP/Request.pm line 82.

Is there any way to get cpanm working again?

chexmix commented 3 years ago

Downloading URI-1.71.tar.gz with curl and installing with cpanm worked.

And this fixed the issue. I'm relieved but confused.

miyagawa commented 3 years ago

there's also --no-lwp option to bypass LWP when you broke LWP that way, by falling back to curl, wget or HTTP::Tiny.