cpan App::cpanminus 在 Straw 5.18 和 5.20 中失败并出现相同的错误

cpan App::cpanminus fails with identical error in Straw 5.18 & 5.20

我正在尝试在 32 位 Strawberry Perl 5.18.2.2 and/or 5.20.2.1 中 运行 cpan App::cpanminus 并且两个实例都失败并出现相同的错误:

这是日志的最后几行:

Checking if your kit is complete...
Looks good
Generating a dmake-style Makefile
Writing Makefile for App::cpanminus
Writing MYMETA.yml and MYMETA.json
  MIYAGAWA/App-cpanminus-1.7030.tar.gz
  C:\Strawberry\perl\bin\perl.exe Makefile.PL -- OK
Running make for M/MI/MIYAGAWA/App-cpanminus-1.7030.tar.gz
C:Strawberryperlbinperl.exe: not found
dmake.exe:  Error code 255, while making 'blib\lib\App\.exists'
  MIYAGAWA/App-cpanminus-1.7030.tar.gz
  C:\STRAWB~1\c\bin\dmake.exe -- NOT OK
Stopping: 'install' failed for 'App::cpanminus'.

环境是 XP SP3 运行在 OS X 10.8.5 上的 Parallels vm 9.0.24251 中。说来话长,为什么我 运行 XP 是这样的。我只想说,我必须。 Strawberry Perl 运行 非常好,与 OS X 中的原生 Perl 5.12.4 一样好或更好,但我无法让 cpan App::cpanminus 工作这一事实让我非常非常不舒服.套用 OJ:"if the gloves don't fit you can't convict" ... "if the script fails to build, you can't trust the sucker."

注意该错误消息是如何挤出 dir 节点之间的斜杠的。我用 '/' 和 '\' 对 $PATH 进行了编码,错误是一样的。

我从 5.18 升级到 5.20,看看是否能解决问题。它没有......所以问题几乎可以肯定是在我的环境中......或者它是飞行员错误:-(

任何想法将不胜感激,感谢您的阅读。

你有安装mks吗?看看你是否从 cmd.exe 尝试

reg query "HKCU\Software\Microsoft\Command Processor"

根据 How can I make Strawberry Perl's cpan(1) find perl?,mks 设置了一个环境变量 shell,您应该在 运行 cpan

之前禁用它
set shell=

或者如果这不起作用并且其 cmd.exe 扩展将您的 perl 配置 ( lib\Config_heavy.pl ) 编辑为 ignore/disable 命令扩展,这意味着将其从

更改
$ perl -V:sh
sh='cmd /x /c';

更改为 cmd /E:off /c 又名 cmd /y /c,意思是 /E:OFF Disable command extensions

谢谢@ikegami,但我几乎从来没有运行 cmd.exe;总是 sh.exe,正如@optional 正确推断的那样。