无法使用cpan安装JSON :: Parse

时间:2016-11-24 09:04:28

标签: json perl cpan

我正在尝试通过cpan在旧的Debian Etch服务器上安装JSON :: Parse。当我这样做时,它失败了:

cpan[2]> install JSON::Parse
CPAN: Storable loaded ok (v2.15)
Going to read /root/.cpan/Metadata
  Database was generated on Wed, 23 Nov 2016 14:41:02 GMT
Running install for module 'JSON::Parse'
Running make for B/BK/BKB/JSON-Parse-0.48.tar.gz
CPAN: Digest::SHA loaded ok (v5.86)
CPAN: Compress::Zlib loaded ok (v2.068)
Checksum for /root/.cpan/sources/authors/id/B/BK/BKB/JSON-Parse-0.48.tar.gz ok
Scanning cache /root/.cpan/build for sizes
............................................................................DONE
JSON-Parse-0.48/
JSON-Parse-0.48/unicode.c
JSON-Parse-0.48/examples/
JSON-Parse-0.48/t/
JSON-Parse-0.48/errors.c
JSON-Parse-0.48/lib/
JSON-Parse-0.48/utf8-byte-one.c
JSON-Parse-0.48/json-entry-points.c
JSON-Parse-0.48/json-common.c
JSON-Parse-0.48/json-perl.c
JSON-Parse-0.48/MANIFEST
JSON-Parse-0.48/MANIFEST.SKIP
JSON-Parse-0.48/typemap
JSON-Parse-0.48/utf8-next-byte.c
JSON-Parse-0.48/script/
JSON-Parse-0.48/unicode.h
JSON-Parse-0.48/json-whitespace.c
JSON-Parse-0.48/Json3.xs
JSON-Parse-0.48/Makefile.PL
JSON-Parse-0.48/README
JSON-Parse-0.48/Changes
JSON-Parse-0.48/META.yml
JSON-Parse-0.48/META.json
JSON-Parse-0.48/script/validjson
JSON-Parse-0.48/lib/JSON/
JSON-Parse-0.48/lib/JSON/Tokenize.pod
JSON-Parse-0.48/lib/JSON/Parse.pm
JSON-Parse-0.48/lib/JSON/Tokenize.pm
JSON-Parse-0.48/lib/JSON/Parse.pod
JSON-Parse-0.48/t/collision.t
JSON-Parse-0.48/t/whitespace.t
JSON-Parse-0.48/t/test.json
JSON-Parse-0.48/t/syntax.t
JSON-Parse-0.48/t/valid-json.t
JSON-Parse-0.48/t/numbers.t
JSON-Parse-0.48/t/unicode.t
JSON-Parse-0.48/t/perl-monks-1165399.t
JSON-Parse-0.48/t/array.t
JSON-Parse-0.48/t/syntax-error-1.json
JSON-Parse-0.48/t/kolmorogov42-1.t
JSON-Parse-0.48/t/object.t
JSON-Parse-0.48/t/utf8.t
JSON-Parse-0.48/t/Json3.t
JSON-Parse-0.48/t/test-empty-string.t
JSON-Parse-0.48/t/read-file.t
JSON-Parse-0.48/t/rfc7159.t
JSON-Parse-0.48/t/JSON-Parse.t
JSON-Parse-0.48/examples/assert.pl
JSON-Parse-0.48/examples/sasori.pl
JSON-Parse-0.48/examples/tokenize-synopsis.pl
JSON-Parse-0.48/examples/bad-utf8.pl
JSON-Parse-0.48/examples/kani.pl
JSON-Parse-0.48/examples/true-subs.pl
JSON-Parse-0.48/examples/long-number.pl
JSON-Parse-0.48/examples/synopsis.pl
JSON-Parse-0.48/examples/collide.pl
JSON-Parse-0.48/examples/array.pl
JSON-Parse-0.48/examples/key-collision.pl
JSON-Parse-0.48/examples/first-bit.pl
JSON-Parse-0.48/examples/json-tiny-round-trip-demo.pl
JSON-Parse-0.48/examples/chr.pl
JSON-Parse-0.48/examples/bad-utf8.txt
JSON-Parse-0.48/examples/ebi.pl
JSON-Parse-0.48/examples/hash.pl
CPAN: File::Temp loaded ok (v0.2304)
CPAN: YAML loaded ok (v0.88)

  CPAN.pm: Going to build B/BK/BKB/JSON-Parse-0.48.tar.gz

Checking if your kit is complete...
Looks good
Warning: Perl version 5.008009 or higher required. We run 5.008008.
JSON::PP 2.27103 is not available
 at /usr/local/share/perl/5.8.8/CPAN/Meta/Converter.pm line 57.
 at /usr/local/share/perl/5.8.8/ExtUtils/MM_Any.pm line 831.
Generating a Unix-style Makefile
Writing Makefile for JSON::Parse
Writing MYMETA.yml and MYMETA.json
cp lib/JSON/Parse.pod blib/lib/JSON/Parse.pod
cp lib/JSON/Tokenize.pm blib/lib/JSON/Tokenize.pm
cp lib/JSON/Tokenize.pod blib/lib/JSON/Tokenize.pod
cp lib/JSON/Parse.pm blib/lib/JSON/Parse.pm
Running Mkbootstrap for JSON::Parse ()
chmod 644 Parse.bs
/usr/bin/perl /usr/local/share/perl/5.8.8/ExtUtils/xsubpp  -typemap /usr/share/perl/5.8/ExtUtils/typemap -typemap typemap  Json3.xs
> Json3.xsc && mv Json3.xsc Json3.c
cc -c   -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -pipe -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"0.48\" -DXS_VERSION=\"0.48\" -fPIC "-I/usr/lib/perl/5.8/CORE"   Json3.c
rm -f blib/arch/auto/JSON/Parse/Parse.so
cc  -shared -L/usr/local/lib Json3.o  -o blib/arch/auto/JSON/Parse/Parse.so     \
                \

chmod 755 blib/arch/auto/JSON/Parse/Parse.so
/usr/bin/perl -MExtUtils::Command::MM -e 'cp_nonempty' -- Parse.bs blib/arch/auto/JSON/Parse/Parse.bs 644
cp script/validjson blib/script/validjson
/usr/bin/perl -MExtUtils::MY -e 'MY->fixin(shift)' -- blib/script/validjson
Manifying blib/man3/JSON::Parse.3pm
Manifying blib/man3/JSON::Tokenize.3pm
  BKB/JSON-Parse-0.48.tar.gz
  /usr/bin/make -- OK
Running make test
Running Mkbootstrap for JSON::Parse ()
chmod 644 Parse.bs
PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'b
lib/lib', 'blib/arch')" t/*.t
t/array.t ............... ok
t/collision.t ........... ok
t/JSON-Parse.t .......... ok
t/Json3.t ............... ok
t/kolmorogov42-1.t ...... ok
t/numbers.t ............. 1/? Attempt to free unreferenced scalar: SV 0x814ebe0, Perl interpreter: 0x814e008 during global destructi
on.
t/numbers.t ............. ok
t/object.t .............. ok
t/perl-monks-1165399.t .. 1/? Use of uninitialized value in undef operator at t/perl-monks-1165399.t line 38.
t/perl-monks-1165399.t .. ok
t/read-file.t ........... ok
t/rfc7159.t ............. ok
t/syntax.t .............. ok
t/test-empty-string.t ... ok
t/unicode.t ............. ok
t/utf8.t ................ ok
t/valid-json.t .......... All 5 subtests passed
t/whitespace.t .......... ok

Test Summary Report
-------------------
t/valid-json.t        (Wstat: 11 Tests: 5 Failed: 0)
  Non-zero wait status: 11
  Parse errors: No plan found in TAP output
Files=16, Tests=277,  0 wallclock secs ( 0.05 usr  0.01 sys +  0.25 cusr  0.04 csys =  0.35 CPU)
Result: FAIL
Failed 1/16 test programs. 0/277 subtests failed.
make: *** [test_dynamic] Error 255
  BKB/JSON-Parse-0.48.tar.gz
  /usr/bin/make test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
  reports BKB/JSON-Parse-0.48.tar.gz
Running make install
  make test had returned bad status, won't install without force
Failed during this command:
 BKB/JSON-Parse-0.48.tar.gz                   : make_test NO

就像我说的那样,它是一个旧的Debian Etch服务器,它也运行旧版本的cpan:

# cpan -v
/usr/bin/cpan script version 1.9, CPAN.pm version 1.9205

任何人都可以提供任何提示吗?

2 个答案:

答案 0 :(得分:2)

您的错误包括:

  

警告:需要Perl版本5.008009或更高版本。我们运行5.008008。

当前版本的JSON :: Parse(0.48)需要比您拥有的更新版本的Perl。

在0.25版中添加了此最低版本要求。但是看看CPAN测试人员的结果,似乎只记录了一段时间以来存在的问题。您might be able to install version 0.18,但建议您使用更新版本的Perl升级到Debian版本。

答案 1 :(得分:0)

如果JSON :: Parse不是您想要的任何东西的依赖项。您可以使用JSON来完成相同的操作。

#!/usr/bin/perl
use strict;
use warnings;

use JSON;

my $jsonString = "{\"foo\":\"bar\"}";
my $hash = decode_json($jsonString);
print ${$hash}{"foo"} . "\n";