1

我一直在尝试安装 Date::Manip perl 模块,但一直收到此错误

[root@localhost ~]# cpanm Date::Manip
! Finding Date::Manip on cpanmetadb failed.
! cannot open file '/root/.cpanm/sources/http%www.cpan.org/02packages.details.txt.gz':   
  No such file or directory opening compressed index
! Couldn't find module or a distribution Date::Manip

cpanmetadb 网站有什么问题?使用 cpanm 运行 --verbose 选项让我得到了这个输出

[root@localhost .cpanm]# cpanm Date::Manip --verbose
cpanm (App::cpanminus) 1.7001 on perl 5.010001 built for x86_64-linux-thread-multi
Work directory is /root/.cpanm/work/1380194227.8657
You have make /usr/bin/make
You have LWP 5.833
You have /bin/tar: tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by John Gilmore and Jay Fenlason.
You have /usr/bin/unzip
Searching Date::Manip on cpanmetadb ...
! Finding Date::Manip on cpanmetadb failed.
Searching Date::Manip () on metacpan ...
! Could not find a release matching Date::Manip () on MetaCPAN.
Searching Date::Manip on mirror http://www.cpan.org ...
Downloading index file http://www.cpan.org/modules/02packages.details.txt.gz ...
Uncompressing index file...
! cannot open file '/root/.cpanm/sources/http%www.cpan.org
/02packages.details.txt.gz':      No such file or directory opening compressed index
! Couldn't find module or a distribution Date::Manip
4

3 回答 3

2

文件名有问题。

! cannot open file '/root/.cpanm/sources/http%www.cpan.org <-- newline and %
/02packages.details.txt.gz': 

我怀疑你的 cpan(m) 配置有问题。

也许sellf升级有帮助

cpanm --verbose --self-upgrade
cpanm --reinstall App::cpanminus

您可以使用 cpanm 从直接 URL 安装一些东西:

cpanm http://search.cpan.org/CPAN/authors/id/S/SB/SBECK/Date-Manip-6.41.tar.gz

或者您可以尝试使用镜子:

cpanm --mirror http://cpan.cpantesters.org/ Date::Manip
于 2013-09-26T12:47:24.927 回答
1

对于使用 perlbrew 的 bin/cpanm 失败的所有 cpanm 安装尝试,我遇到了同样的问题。花了几个步骤来修复。实际上,cpan 无法离开我的 LAN,因此我必须在 wgetrc 和 .curlrc 之外的其他位置指定我的代理。

  1. 确保您使用以下方法设置了环境变量:

     export HTTP_PROXY="http://my_url_to_proxy:my_port"
    
  2. 确保 cpan 具有相同的代理设置:

     cpan
     o conf /proxy/
    

    现在查看 http_proxy 的值,如果它为空,请继续下一行:

     o conf init http_proxy
    

    键入 ENTER,然后输入值。

     http_proxy         [http://my_url_to_proxy:my_port]
    

那是给我的。如果仍然有问题,请在 cpan 中发出以下命令:

o conf

并查看“curl”和“wget”的设置。确保它们不是空的“[]”。至少一个应该有一个值,例如:

wget               [/usr/bin/wget]

我建议您在命令行上自行测试 wget 和/或 curl,以确保您甚至可以通过发出以下命令访问 cpan.org:

wget -qO- http://search.cpan.org

查看您是否将数据流发送到控制台。如果没有,请先解决该问题。

于 2016-10-31T17:13:15.780 回答
0

wget 或 curl 对该文件有效吗?由于一些网络问题,我有同样的 cpanm 问题。尝试:

wget http://www.cpan.org/modules/02packages.details.txt.gz
curl -O http://www.cpan.org/modules/02packages.details.txt.gz
于 2017-03-02T10:15:50.883 回答