Linux 在@INC 中找不到 CPAN.pm(@INC 包含:/usr/local/lib/perl5 /usr/local/share/perl5
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/16321197/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5
提问by HelenaM
I tried to install some modules to a new server (fedora core 18) but I'm betting this error:
我试图将一些模块安装到新服务器(fedora core 18),但我打赌这个错误:
Can't locate CPAN.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .).
BEGIN failed--compilation aborted.
The module I need to install is : XML/Writer.pm
我需要安装的模块是:XML/Writer.pm
because I'm getting this error:
因为我收到此错误:
Can't locate XML/Writer.pm in @INC (@INC contains: /usr/local/lib/perl5 /usr/local/share/perl5 /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5 /usr/share/perl5 .
Any of you knows why or how can I fix this errors?
你们中的任何人都知道为什么或如何解决此错误?
采纳答案by Miguel Prz
Some OS distributions cut out pieces of the core Perl distributions. In this case, it appears that the very tool to install modules was gutted out, so you need to get the OS to install it.
一些操作系统发行版削减了核心 Perl 发行版的一部分。在这种情况下,安装模块的工具似乎被掏空了,所以你需要让操作系统来安装它。
Try to install CPAN using
尝试使用安装 CPAN
yum -y install perl-CPAN
and then use cpan
command to install the required modules
然后使用cpan
命令安装所需的模块
cpan XML::Writer