1

我正在尝试以用户身份安装 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 我会得到完全相同的输出。

请问怎么了?

4

2 回答 2

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显式安装。

于 2014-06-25T17:42:50.523 回答
0

我没有告诉 cpanminus 使用我当地的图书馆。

这是以用户身份安装所有模块的解决方案:

cd ~/;
cpanm local::lib;
echo 'eval `perl -I$HOME/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bashrc ;
source ~/.bashrc;

之后,我可以以用户身份安装所有模块和依赖项

cpanm module::name
于 2014-06-26T17:04:50.477 回答