运行 intellij 中的 perl 测试:无法加载模块 PassEnv

Running perl test in intellij: Can't load module PassEnv at

我想在由测试派生的 intellij 中创建 perl 模块。我在一个新项目中创建了以下测试,如下所示

#!/usr/bin/perl
use strict;
use warnings;
use Test::More;

done_testing();

但是当我尝试 运行 测试 (Shift+Alt+F10) 时,它失败并出现以下错误

Testing started at 10:51 ... C:/Strawberry/perl/bin\perl.exe C:/Strawberry/perl/bin/prove.bat -PPassEnv --formatter TAP::Formatter::Camelcade --merge --recurse --jobs 1 D:/workspace/code/repo/Modules/ImageUtilities/ReaConverterTest.t Can't load module PassEnv at C:/Strawberry/perl/bin/prove.bat line 26.
Process finished with exit code 2

但是当我 运行 从命令行进行测试时它工作正常

$ perl -w ReaConverterTest.t
1..0

我看到报告了一个关于 intellij perl 插件(https://github.com/Camelcade/Perl5-IDEA/issues/1966)的问题,但它已关闭。看起来它已在 2019.1 Perl 中修复,但我不知道为什么它对我来说失败了。

知道如何解决这个问题吗?

PS:我正在使用 Git-Bash 到 运行 Perl 脚本,IntelliJ 在 windows 上使用草莓 Perl 安装作为 Perl 解释器。


更新

当我通过添加 "use PassEnv" 运行 脚本时,它失败了,因为没有这样的模块从 intellij 搜索也会导致 "no such module"

perl -w ReaConverter.t
Can't locate PassEnv.pm in @INC (you may need to install the PassEnv module) (@INC contain
s: /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/sha
re/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl) at ReaConverter.
t line 6.
BEGIN failed--compilation aborted at ReaConverter.t line 6.

由于使用了 -PPassEnv 选项,prove 尝试加载 App::Prove::Plugin::PassEnv。它尚未安装。只需安装模块。

注意:您想使用 Strawberry Perl 安装它,因此以下似乎是您首选 shell 中的适当命令:

/c/Strawberry/perl/bin/cpanm App::Prove::Plugin::PassEnv