![](/img/trans.png)
[英]Why do I get “404 Not Found” and “Failed to change directory” errors when I try to install a Perl module with cpan?
[英]cpan install switch failed
我是新手,並學習Perl編程。 我對cpan感到困惑,我知道有數千個支持perl的庫,但是,如何從cpan安裝庫? 我在Linux中使用cpan時,當我嘗試安裝開關時,出現錯誤消息
cpan[1]> install Switch
和安裝時出現錯誤:
Reading '/root/.cpan/Metadata'
Database was generated on Mon, 13 Jan 2014 08:29:02 GMT
Running install for module 'Switch'
Running make for R/RG/RGARCIA/Switch-2.16.tar.gz
Checksum for /root/.cpan/sources/authors/id/R/RG/RGARCIA/Switch-2.16.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
CPAN.pm: Building R/RG/RGARCIA/Switch-2.16.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for Switch
Writing MYMETA.yml and MYMETA.json
cp Switch.pm blib/lib/Switch.pm
Manifying blib/man3/Switch.3
RGARCIA/Switch-2.16.tar.gz
/usr/bin/make -- OK
'YAML' not installed, will not store persistent state
Running make test
PERL_DL_NONLAZY=1 /usr/bin/perl5.18.1 "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/given.t ... Failed 2/293 subtests
t/nested.t .. ok
t/switch.t .. ok
Test Summary Report
-------------------
t/given.t (Wstat: 0 Tests: 293 Failed: 2)
Failed tests: 2-3
Files=3, Tests=590, 4 wallclock secs ( 0.31 usr 0.01 sys + 2.38 cusr 0.03 csys = 2.73 CPU)
Result: FAIL
Failed 1/3 test programs. 2/590 subtests failed.
make: *** [test_dynamic] Error 255
RGARCIA/Switch-2.16.tar.gz
/usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports RGARCIA/Switch-2.16.tar.gz
Running make install
make test had returned bad status, won't install without force
Failed during this command:
RGARCIA/Switch-2.16.tar.gz : make_test NO
如何安裝開關? 謝謝
您所做的一切都正確,但是在Perl 5.13.3及更高版本上 Switch 損壞了 。 模塊的維護者知道此問題,並且似乎對解決此問題不感興趣。 考慮到模塊的維護不力,即使您確實說服了它進行安裝,在生產代碼中似乎也不建議使用它。
最近在PerlMonks上進行的一些相關討論,討論了類似開關的構造:
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.