使用cpan命令行时出错

时间:2017-07-27 12:36:59

标签: perl cpan activeperl

使用cpan命令行时出现以下错误:

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

我试图在命令提示符下使用cpan App :: cpanminus命令安装cpanm。

我在防火墙后面并且还在http_proxy env变量中配置了pac文件。我正在使用ActivePerl。

1 个答案:

答案 0 :(得分:0)

return "DIRECT";是您经常在代理配置文件中看到的内容,因此您可以在正确设置代理之前将其下载到02packages.details.txt.gz中。

确定代理设置正确后,请删除此文件并再次运行cpan。然后cpan将下载包文件的新副本。

  

一旦确定您的代理设置正确...

cpan具有可能需要配置的代理设置才能使其正常工作。 从cpan提示符运行o conf /proxy/以查看它们。

例如,在我的工作机器上,我有设置

http_proxy     [http://proxymachine.mycompany.com:82]
no_proxy       [localhost,127.0.0.1,internalsite.mycompany.com]