【问题标题】:Error while using cpan command line使用 cpan 命令行时出错
【发布时间】:2018-01-03 04:44:21
【问题描述】:

我在使用 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 环境变量中配置了 pac 文件。我正在使用 ActivePerl。

【问题讨论】:

  • 有人遇到过同样的问题吗?我仍然面临这个问题。

标签: perl cpan activeperl


【解决方案1】:

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]

【讨论】:

  • 我只在 env 变量中进行了代理设置,而不是在任何 perl 配置文件中。错误是由那个引起的吗??
  • 当我尝试删除这个文件但正在下载的文件也抛出了同样的错误
  • 你在conf文件和env变量中都做了设置
  • 当我调用 cpan 时,我认为 cpan 没有使用我的本地家庭配置
猜你喜欢
  • 2017-02-07
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多