由于缺少“make”,Cpanm 无法安装任何模块

ZzZ*_*mbo 6 cpanm

我最近安装了 XAMPP。到目前为止一切都很好,但有一件事让我无法休息:我无法通过 cpanm 获取任何模块。典型的安装日志如下所示:

cpanm (App::cpanminus) 1.6005 on perl 5.016003 built for MSWin32-x86-multi-thread
Work directory is C:\Users\2B86~1/.cpanm/work/1448496711.6352
You have LWP 6.04
You have C:\Users\boss\AppData\Local\Atlassian\SourceTree\git_local\bin\tar.exe, C:\Users\boss\AppData\Local\Atlassian\SourceTree\git_local\bin\gzip.exe and C:\Users\boss\AppData\Local\Atlassian\SourceTree\git_local\bin\bzip2.exe
You have C:\Users\boss\AppData\Local\Atlassian\SourceTree\git_local\bin\unzip.exe
Searching DateTime::Tiny on cpanmetadb ...
--> Working on DateTime::Tiny
Fetching http://www.cpan.org/authors/id/A/AD/ADAMK/DateTime-Tiny-1.04.tar.gz
-> OK
Unpacking DateTime-Tiny-1.04.tar.gz
Entering DateTime-Tiny-1.04
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.64)
Configuring DateTime-Tiny-1.04
Running Makefile.PL
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (6.64)
-> FAIL Can't configure the distribution. You probably need to have 'make'. See C:\Users\2B86~1\.cpanm\build.log for details.
Run Code Online (Sandbox Code Playgroud)

该行-> FAIL Can't configure the distribution. You probably need to have 'make'. See C:\Users\2B86~1\.cpanm\build.log for details.旨在指示错误,但我确实在与 cpanm 相同的目录中有 make.exe。

有点史前史,我在安装 xampp 之前安装了 Strawberry Perl,不知道它已经内置了 Perl。发现我决定卸载前者后,cpanm突然开始遇到这个错误。我仔细检查了一遍,在我的 Strawberry Perl 安装中没有找到 make.exe 的踪迹,但它工作得很好,而且当它们共存时,来自 xampp 的 cpanm 也能工作。

我试图在谷歌上寻求帮助,但它提出了sudo apt-get install build-essentials类似的建议。

小智 0

我使用的是 Windows 10 64 位专业版。我最近从 berrybrew 切换回 Strawberry Perl 并遇到了同样的问题。我能够通过完全卸载旧的 Perl 并清除找到它们的以下文件夹(在 C: 驱动器上搜索).cpanm、.cpantesters 和 .cpanreporter 来解决这个问题。您可能只需要清除 .cpanm 文件夹,但为了更好的措施,我清除了其他文件夹。(在删除最后两个文件之前保存文件metabase_id.json)事实证明,在我的例子中,新的perl没有安装App::cpanminus,所以当我安装新的perl时,当我尝试运行cpanm时它丢失了Install::Some::App 因为它找到了该文件夹,但不是其中的所有部分。