问题
I am getting the below errors while using cpan command line:
Reading 'C:\Perl64\cpan\sources\modules\02packages.details.txt.gz'
Warning: Your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz does not
contain a Line-Count header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
CPAN: Time::HiRes loaded ok (v1.9741)
Warning: Your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz does not
contain a Last-Updated header.
Please check the validity of the index file by comparing it to more
than one CPAN mirror. I'll continue but problems seem likely to
happen.
........Could not split line[" return \"DIRECT\";"]
Could not split line[""]
........Could not split line[" return \"DIRECT\";"]
Could not split line[""]
Giving up parsing your C:\Perl64\cpan\sources\modules\02packages.details.txt.gz,
too many errors
I was trying to install cpanm using cpan App::cpanminus command in command prompt.
I am behind a firewall and have configured the pac file in the http_proxy env variable also. I am using ActivePerl.
回答1:
return "DIRECT";
is something you will often see in a proxy configuration file, so that's what you probably downloaded into 02packages.details.txt.gz
before your proxy was set up correctly.
Once you're sure that your proxy is set up correctly, delete this file and run cpan
again. Then cpan
will download a fresh copy of the package file.
Once you're sure that your proxy is set up correctly ...
cpan
has proxy settings that may need to be configured to get this working.
Run o conf /proxy/
from the cpan prompt to see them.
On my work machine, for example, I have the settings
http_proxy [http://proxymachine.mycompany.com:82]
no_proxy [localhost,127.0.0.1,internalsite.mycompany.com]
来源:https://stackoverflow.com/questions/45351030/error-while-using-cpan-command-line