无法在@INC中找到Module / Build.pm(@INC包含:/ usr / local / lib64 / perl5

时间:2014-02-14 16:27:52

标签: perl

我正在使用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上执行。

我尝试从此站点关注其他解决方案,但由于Module :: Build错误,我仍然遇到该错误并且无法安装其他TAP。是我安装perl-CPAN而不是yum版本,还是应该转到5.10.1以外的其他版本

4 个答案:

答案 0 :(得分:11)

只需先安装Module :: Build

cpan Module::Build

答案 1 :(得分:3)

安装模块构建:

cpan Module::Build

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

cpan Test::Harness::Straps

答案 2 :(得分:0)

只需运行此命令

sudo yum install cpan

答案 3 :(得分:-1)

Ubuntu 16-18笔记:

使用sudo运行

apt install cpan #after install, run cpan
cpan

在cpan cli中,输入内容并点击Enter

install Module::Build

也可以在cpan cli中安装附加的Netmask模块,长时间编译需要多次按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