我在Windows上使用Strawberry Perl 64位(5.26.2.1)。一些CPAN模块正确安装,例如Log :: Log4perl。但是,许多不同的模块安装失败并出现相同的错误:'.' is not recognized as an internal or external command
。
我不确定该如何处理。我最好的猜测是,这些模块可能不适用于Windows,但这只是猜测。一个例子是Text :: Trim,它的文档中没有任何消息,它不能在Windows上运行。
如果您知道如何使CPAN安装消息更加详细,那么这也可能有助于跟踪此问题。这是错误:
cpan[6]> install Text::Trim
install Text::Trim
Running install for module 'Text::Trim'
Checksum for C:\Users\me\.cpan\sources\authors\id\M\MA\MATTLAW\Text-Trim-1.02.tar.gz ok
Configuring M/MA/MATTLAW/Text-Trim-1.02.tar.gz with Build.PL
Created MYMETA.yml and MYMETA.json
Creating new 'Build' script for 'Text-Trim' version '1.02'
MATTLAW/Text-Trim-1.02.tar.gz
C:\Strawberry\perl\bin\perl.exe Build.PL installdirs=site -- OK
Running Build for M/MA/MATTLAW/Text-Trim-1.02.tar.gz
Building Text-Trim
MATTLAW/Text-Trim-1.02.tar.gz
C:\Strawberry\perl\bin\perl.exe ./Build -- OK
Running Build test
t\01..trim.t ..... ok
t\02..ltrim.t .... ok
t\03..rtrim.t .... ok
t\04..unicode.t .. ok
t\05..undef.t .... ok
t\99..pod.t ...... ok
All tests successful.
Files=6, Tests=63, 2 wallclock secs ( 0.05 usr + 0.70 sys = 0.75 CPU)
Result: PASS
MATTLAW/Text-Trim-1.02.tar.gz
C:\Strawberry\perl\bin\perl.exe ./Build test -- OK
Running Build install
'.' is not recognized as an internal or external command,
operable program or batch file.
MATTLAW/Text-Trim-1.02.tar.gz
./Build install -- NOT OK
Failed during this command:
MATTLAW/Text-Trim-1.02.tar.gz : install NO
请注意,我也安装了Berrybrew,所以我也认为它们可以相互干扰,但Log :: Log4perl工作的事实让我觉得它相对不太可能。
编辑:奇怪的是,使用 cpanm 安装Text :: Trim工作......
编辑:评论中的每个请求,下面是来自cpan命令提示符的o conf
的输出。但请注意,正在运行的cpan位于C:\berrybrew\5.26.1_64\perl\bin\cpan.bat
,因此从C:\Strawberry\c\bin
获取某些内容的其他版本非常奇怪。
cpan[2]> o conf
$CPAN::Config options from C:\Users\me\.cpan/CPAN/MyConfig.pm:
commit [Commit changes to disk]
defaults [Reload defaults from disk]
help [Short help about 'o conf' usage]
init [Interactive setting of all options]
applypatch []
auto_commit [0]
build_cache [100]
build_dir [C:\Users\me\.cpan\build]
build_dir_reuse [0]
build_requires_install_policy [yes]
bzip2 [/mingw64/bin/bzip2]
cache_metadata [1]
check_sigs [0]
cleanup_after_install undef
colorize_debug undef
colorize_output [0]
colorize_print undef
colorize_warn undef
commandnumber_in_prompt [1]
commands_quote undef
connect_to_internet_ok [1]
cpan_home [C:\Users\me\.cpan]
curl [C:\Users\me\AppData\Local\Continuum\Anaconda3\Library\bin\curl.EXE]
dontload_hash undef
dontload_list undef
ftp undef
ftp_passive [1]
ftp_proxy []
ftpstats_period undef
ftpstats_size undef
getcwd [cwd]
gpg [/usr/bin/gpg]
gzip [/usr/bin/gzip]
halt_on_failure [0]
histfile [C:\Users\me\.cpan\histfile]
histsize [100]
http_proxy []
inactivity_timeout [0]
index_expire [1]
inhibit_startup_message [0]
keep_source_where [C:\Users\me\.cpan\sources]
load_module_verbosity [none]
lynx undef
make [C:\Strawberry\c\bin\gmake.EXE]
make_arg []
make_install_arg []
make_install_make_command [C:\Strawberry\c\bin\gmake.EXE]
makepl_arg [INSTALLDIRS=site]
mbuild_arg []
mbuild_install_arg []
mbuild_install_build_command [./Build]
mbuildpl_arg [installdirs=site]
ncftp undef
ncftpget undef
no_proxy []
pager [C:\windows\system32\more.COM]
password undef
patch [C:\Strawberry\c\bin\patch.EXE]
patches_dir undef
perl5lib_verbosity [none]
plugin_list
prefer_external_tar [0]
prefer_installer [MB]
prefs_dir [C:\Users\me\.cpan\prefs]
prerequisites_policy [follow]
proxy_pass undef
proxy_user undef
randomize_urllist undef
recommends_policy [1]
scan_cache [atstart]
shell [C:\windows\system32\cmd.exe]
show_unparsable_versions [0]
show_upload_date [0]
show_zero_versions [0]
suggests_policy [0]
tar [/usr/bin/tar]
tar_verbosity [none]
term_is_latin [1]
term_ornaments [1]
test_report [0]
trust_test_report_history [0]
unzip [/usr/bin/unzip]
urllist
0 [http://www.cpan.org/]
use_prompt_default [0]
use_sqlite [0]
username undef
version_timeout [15]
wait_list undef
wget []
yaml_load_code [0]
yaml_module [YAML]