为什么 cpanm 不安装依赖项?

Why won't cpanm install dependencies?

我正在尝试从 cpanm 安装 PAR,如下所示:cpanm App::Packer::PAR,但出现此错误:

skipping R/RJ/RJBS/perl-5.22.0.tar.bz2
! Installing the dependencies failed: Module ExtUtils::Embed is not installed
! Bailing out the installation for PAR-Packer-1.026.

尽管 cpanm 应该会自动安装依赖项,但我尝试手动安装它:cpanm ExtUtils::Embed,但只得到相同的错误:skipping R/RJ/RJBS/perl-5.22.0.tar.bz2 关于失败的原因以及如何让它发挥作用的任何想法?

ExtUtils::Embed 是一个双寿命模块,这意味着它作为 perl 分布的一部分 as well as 在第二个分布中分布。

cpanm 正在尝试通过安装 perl distribution instead of the ExtUtils-Embed distribution 来安装 ExtUtils::Embed。为什么?我不确定。可能是因为它较新(1.32 而不是 1.2505)。

cpanm 明智地不愿意升级 perl 本身。

现在,最新的 App::Packer::PAR 的 META 没有指定 ExtUtils::Embed 的最低版本,因此 ExtUtils-Embed 发行版中的版本很可能是够好了。以下命令将实现此目的:

cpanm D/DO/DOUGM/ExtUtils-Embed-1.14.tar.gz

但是,正如我之前提到的,ExtUtils::Embed 是 Perl 自带的。它已经这样做了超过 15 年(从 Perl 5.4 之前)。必须安装它是没有意义的。

您似乎正在使用一个系统,其供应商决定通过将 perl 分发分成多个包来引起麻烦。您应该使用系统的包管理器(apt-getyum 或其他)来安装 perl 的缺失部分,而不是使用 cpanm.