Error while using cpan command line

空扰寡人 提交于 2019-12-25 09:29:13

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!