2012-01-18 51 views
1

我在我的機器上安裝了perl 5.008003版本。我正在嘗試使用CPAN安裝XML :: Twig,但由於以下錯誤而失敗。任何人都可以幫忙無法安裝XML :: Twig with Perl 5.008003

t/xmlxpath_22name_select............ok 
t/xmlxpath_23func...................cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_23func...................ok 
t/xmlxpath_24namespaces.............cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_24namespaces.............ok 
t/xmlxpath_25scope..................cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_25scope..................ok 
t/xmlxpath_26predicate..............cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_26predicate..............ok 
t/xmlxpath_28ancestor2..............cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_28ancestor2..............ok 
t/xmlxpath_29desc_with_predicate....cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_29desc_with_predicate....ok 
t/xmlxpath_30lang...................cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_30lang...................ok 
t/xmlxpath_additional...............cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_additional...............ok 
t/xmlxpath_nav......................cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_nav......................ok 
t/xmlxpath_test1....................cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_test1....................ok 
t/xmlxpath_test_twig_roots..........cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_test_twig_roots..........ok 
t/xmlxpath_test_with_handlers.......cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_test_with_handlers.......ok 
t/xmlxpath_xpath_cond...............cannot use XML::Twig::XPath: neither XML::XP 
athEngine 0.09+ nor XML::XPath are available 
t/xmlxpath_xpath_cond...............ok 
t/zz_dump_config.................... 

Configuration: 

perl: 5.008003 
OS: MSWin32 - MSWin32 
required 
    XML::Parser    :    2.34 
'xmlwf' is not recognized as an internal or external command, 
operable program or batch file. 
Use of uninitialized value in sprintf at t/zz_dump_config.t line 113. 
    expat     : <no version information found> 
Strongly Recommended 
    Scalar::Util    :    1.13 (for improved memory management) 
    Encode     :    1.99 (for encoding conversions) 
Modules providing additional features 
    XML::XPathEngine   : <not available> (to use XML::Twig::XPath) 
    XML::XPath    : <not available> (to use XML::Twig::XPath if Tree:: 
XPathEngine not available) 
    LWP      :    5.75 (for the parseurl method) 
    HTML::TreeBuilder  :    3.13 (to use parse_html and parsefile_h 
tml) 
    HTML::Entities::Numbered : <not available> (to allow parsing of HTML containi 
ng named entities) 
    HTML::Tidy    : <not available> (to use parse_html and parsefile_h 
tml with the use_tidy option) 
    HTML::Entities   :    1.27 (for the html_encode filter) 
    Tie::IxHash    : <not available> (for the keep_atts_order option) 
    Text::Wrap    :  2001.09291 (to use the "wrapped" option for p 
retty_print) 
Modules used only by the auto tests 
    Test      :    1.24 
    Test::Pod    : <not available> 
    XML::Simple    :    2.09 
    XML::Handler::YAWriter : <not available> 
    XML::SAX::Writer   : <not available> 
    XML::Filter::BufferText :    1.01 
    IO::Scalar    : <not available> 


Please add this information to bug reports (you can run t\zz_dump_config.t to ge 
t it) 

if you are upgrading the module from a previous version, make sure you read the 
Changes file for bug fixes, new features and the occasional COMPATIBILITY WARNIN 
G 

t/zz_dump_config....................ok 
Failed Test Stat Wstat Total Fail Failed List of Failed 
------------------------------------------------------------------------------- 
t/test_3_36.t    67 1 1.49% 43 
Failed 1/96 test scripts, 98.96% okay. 1/2374 subtests failed, 99.96% okay. 
NMAKE : fatal error U1077: 'C:\WINNT\system32\cmd.exe' : return code '0xff' 
Stop. 
    NMAKE test -- NOT OK 
Running make install 
    make test had returned bad status, won't install without force 

cpan> 

我所有的環境都有這個版本的perl,所以我無法升級到最新版本。我只能解決這個問題。

謝謝,

+0

好像你需要安裝XML :: XPath。手動安裝或設置您的cpan以自動遵循依賴關係。 – 2012-01-18 03:06:12

+0

這是無關緊要的,因爲它並不直接涉及編程;它屬於superuser.com。 – 2012-01-18 04:08:33

+2

其中一項測試失敗。你沒有顯示失敗的測試。你顯示的所有測試都可以。顯示't/test_3_36.t'的輸出。 – ikegami 2012-01-18 04:56:25

回答

2

根據測試的總結,發生故障的一個似乎是噸/ test_3_36.t測試43。如果你看看它,它會在解析HTML時測試HTML :: TreeBuilder如何處理&Amp;(注意大寫字母A)。根據HTML :: TreeBuilder的版本,&Amp;可能會被處理爲&amp;,實體爲&。看起來,在機器上安裝的版本(3.13)中,它的處理(正確)與文字&Amp;一樣,測試沒有預料到。

HTML :: TreeBuilder在使用XML :: Twig來解析HTML時使用。您也可以使用HTML :: Tidy(您將需要安裝它)。

無論這個問題是否足夠重要,您都無法安裝該模塊,我不知道,您必須運用您的最佳判斷。

正如ikegami提到的那樣,您在問題中提供的輸出不是最優的。沒有必要複製所有的警告(有很多,我可能顯示更少,但因爲我希望他們煽動用戶安裝XML :: XPathEngine我會保持原樣輸出)。

+3

適用缺失:在CPAN shell中,運行'force install XML :: Twig'忽略測試失敗並安裝模塊。 – daxim 2012-01-18 08:35:29