我正在尝试以用户身份安装HTML :: TreeBuilder :: XPath。但是我得到了这个错误:
Building and testing HTML-Parser-3.71 ... FAIL
! Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details.
因此,如果我查看此文件 /home/user/.cpanm/build.log ,我会收到此错误:
Result: FAIL
Failed 3/48 test programs. 0/423 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details.
Searching HTML::Parser on cpanmetadb ...
Already tried HTML-Parser-3.71. Skipping.
Already tried HTML::Tagset. Skipping.
-> FAIL Bailing out the installation for HTML-Tree-5.03. Retry with --prompt or --force.
-> FAIL Bailing out the installation for HTML-TreeBuilder-XPath-0.14. Retry with --prompt or --force.
3 distributions installed
所以我尝试手动安装 HTML :: Entities ,我收到此错误:
Successfully installed HTML-Tagset-3.20
Building and testing HTML-Parser-3.71 ... FAIL
! Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details.
1 distribution installed
Can't locate HTML/Tagset.pm in @INC (@INC contains: /home/user/.cpanm/work/1403630727.28688/HTML-Parser-3.71/blib/lib /home/user/.cpanm/work/1403630727.28688/HTML-Parser-3.71/blib/arch /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2 /usr/lib/perl5 /usr/share/perl5 /usr/lib/perl/5.14 /usr/share/perl/5.14 /usr/local/lib/site_perl .) at /home/user/.cpanm/work/1403630727.28688/HTML-Parser-3.71/blib/lib/HTML/TokeParser.pm line 10.
所以它说它找不到HTML :: Tagset,但它之前只安装了几行!最后,我得到了这个错误:
Result: FAIL
Failed 3/48 test programs. 0/423 subtests failed.
make: *** [test_dynamic] Error 255
-> FAIL Installing HTML::Entities failed. See /home/user/.cpanm/build.log for details.
1 distribution installed
如果我看看/home/user/.cpanm/build.log,我会得到完全相同的输出。
请问有什么不对?
答案 0 :(得分:1)
鉴于你无法从命令行找到HTML :: Tagset模块,你可能没有实际安装它,尽管被告知你有。
另一项测试是:
$ perldoc HTML::Tagset
然后我会使用locate(1)
寻找它 $ locate HTML/Tagset.pm
你可能会得到很多你需要经历的输出,或者你可能得不到。您可能会被告知定位所依赖的数据库未初始化或已过期。您可以刷新数据库,也可以尝试find(1)
$ find / -name 'Tagset.pm' -print | less
如果您仍然无法找到它,或者您厌倦了搜索,那么只需启动您最喜爱的CPAN客户端,然后明确安装HTML::Tagset
然后HTML::Entities
。
答案 1 :(得分:0)
我没有告诉cpanminus使用我的本地图书馆。
以下是以用户身份安装所有模块的解决方案:
cd ~/;
cpanm local::lib;
echo 'eval `perl -I$HOME/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bashrc ;
source ~/.bashrc;
之后,我可以用
作为用户安装所有模块和依赖项cpanm module::name