在@INC中找不到模块/Build.pm(@INC包含:/usr/本机/lib 64/perl 5

pzfprimi  于 2022-11-15  发布在  Perl
关注(0)|答案(5)|浏览(169)

我正在使用Centos 6并安装Perl-CPAN和开发工具。我似乎无法安装Test:Harness::Straps,它会出现以下错误:

Can't locate Module/Build.pm in @INC (@INC contains: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 .) at Build.PL line 3.
BEGIN failed--compilation aborted at Build.PL line 3.
Warning: No success on command[/usr/bin/perl Build.PL --installdirs site]

这是我系统:

[rileyta@tpcvm106 Downloads]$ uname -a
Linux tpcvm106 2.6.32-220.7.1.el6.centos.plus.x86_64 #1 SMP Wed Mar 7 11:06:23 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux

[rileyta@tpcvm106 Downloads]$ perl -v

This is perl, v5.10.1 (*) built for x86_64-linux-thread-multi

Copyright 1987-2009, Larry Wall

[rileyta@tpcvm106 Downloads]$ rpm -ql perl-Params-Validate
/usr/lib64/perl5/Attribute
/usr/lib/64/perl5/Attribute/Params
/usr/lib64/perl5/Attribute/Params/Validate.pm
/usr/lib64/perl5/Params
/usr/lib64/perl5/Params/Validate.pm
/usr/lib64/perl5/Params/ValidatePP.pm
/usr/lib64/perl5/Params/ValidateXS.pm
/usr/lib64/perl5/auto/Params
/usr/lib64/perl5/auto/Params/Validate
/usr/lib64/perl5/auto/Params/Validate/Validate.bs
/usr/lib64/perl5/auto/Params/Validate/Validate.so
/usr/share/doc/perl-Params-Validate-0.92
/usr/share/doc/perl-Params-Validate-0.92/Changes
/usr/share/doc/perl-Params-Validate-0.92/LICENSE
/usr/share/doc/perl-Params-Validate-0.92/README
/usr/share/doc/perl-Params-Validate-0.92/TODO
/usr/share/man/man3/Attribute::Params::Validate.3pm.gz
/usr/share/man/man3/Params::Validate.3pm.gz
/usr/share/man/man3/Params::ValidatePP.3pm.gz
/usr/share/man/man3/Params::ValidateXS.3pm.gz

下面是我的cpan设置:

cpan[2]> o conf
$CPAN::Config options from /usr/share/perl5/CPAN/Config.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         undef
auto_commit        [1]
build_cache        [100]
build_dir          [/root/.cpan/build]
build_dir_reuse    [0]
build_requires_install_policy [yes]
bzip2              undef
cache_metadata     [1]
check_sigs         [0]
colorize_debug     undef
colorize_output    undef
colorize_print     undef
colorize_warn      undef
commandnumber_in_prompt [1]
commands_quote     undef
connect_to_internet_ok [0]
cpan_home          [/root/.cpan]
curl               undef
dontload_hash      undef
dontload_list      undef
ftp                undef
ftp_passive        [1]
ftp_proxy          []
ftpstats_period    undef
ftpstats_size      undef
getcwd             [cwd]
gpg                undef
gzip               undef
halt_on_failure    [0]
histfile           undef
histsize           undef
http_proxy         []
inactivity_timeout [0]
index_expire       [1]
inhibit_startup_message [0]
keep_source_where  [/root/.cpan/sources]
load_module_verbosity [v]
lynx               undef
make               undef
make_arg           []
make_install_arg   []
make_install_make_command []
makepl_arg         [INSTALLDIRS=site]
mbuild_arg         []
mbuild_install_arg []
mbuild_install_build_command [sudo ./Build]
mbuildpl_arg       [--installdirs site]
ncftp              undef
ncftpget           undef
no_proxy           []
pager              [/usr/bin/less]
password           undef
patch              undef
patches_dir        undef
perl5lib_verbosity [v]
prefer_external_tar undef
prefer_installer   [MB]
prefs_dir          [/root/.cpan/prefs]
prerequisites_policy [ignore]
proxy_pass         undef
proxy_user         undef
randomize_urllist  undef
scan_cache         [atstart]
shell              [/bin/sh]
show_unparsable_versions undef
show_upload_date   [0]
show_zero_versions undef
tar                undef
tar_verbosity      [v]
term_is_latin      [1]
term_ornaments     [1]
test_report        undef
trust_test_report_history [0]
unzip              undef
urllist             0 [www.cpan.org]    1 [http://mirror.uta.edu/CPAN/]     2 [ftp://mirror.quintex.com/CPAN/]  3 [http://cpan.cs.utah.edu/CPAN/]
use_sqlite         [0]
username           undef
version_timeout    undef
wait_list          undef
wget               undef
yaml_load_code     [0]
yaml_module        undef

我是否应该更改mbuild_install_build_command?我使用sudo在此CPU上执行。
我试着从这个网站上按照其他的解决方案,但我仍然得到错误,不能安装其他的TAP,因为模块::构建错误。是我安装perl-CPAN,而不是yum版本,还是我应该去其他版本而不是5.10.1

t9aqgxwy

t9aqgxwy1#

只需先安装Module::Build

cpan Module::Build
elcex8rz

elcex8rz2#

安装模块内部版本:

cpan Module::Build

或者允许cpan为您安装依赖项:

cpan Test::Harness::Straps
jhdbpxl9

jhdbpxl93#

Ubuntu 16-18注意事项:
使用sudo运行

apt install cpan #after install, run cpan
cpan

在cpan cli中,写入并按Enter键

install Module::Build

另外,在cpan cli中,您可以安装其他网络掩码模块,需要多次按Y键进行长时间编译

install Net::Netmask

所以在安装cpan之后,你可能需要重新启动,毕竟,尝试运行

perl ./Build.PL #don't worry about warnings with "META" generation..
sudo ./Build installdeps #you may see message All prerequisites satisfied
sudo ./Build test
sudo ./Build install
6ljaweal

6ljaweal4#

只需运行此命令

sudo yum install cpan
nhaq1z21

nhaq1z215#

适用于Ubuntu 20.04:

apt install perl

相关问题