无法安装JSON.pm

时间:2018-05-13 16:17:03

标签: json perl perl-module

我正在尝试使用Perl脚本将我的数据结构转换为JSON格式的字符串。这使用pl folder here

中的asm2stats.pl Perl脚本

这是我使用的命令行

perl /Users/Buscou.out/ACG-scaffold.fa > output.json

但是我遇到了这个问题:

  

无法在@INC中找到JSON.pm(您可能需要安装JSON模块)(@INC包含:/ Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 / Network /Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 /System/Library/Perl/5.18/darwin-thread-multi-2level / System /Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18。)at / Users / etudiant / Downloads / assembly-stats-master / pl / asm2stats.pl第5行。       BEGIN失败 - 汇编在/Users/etudiant/Downloads/assembly-stats-master/pl/asm2stats.pl第5行中止。

通过互联网查看,我做了这些安装:

brew install cpanm

sudo cpan JSON

但我仍然得到同样的错误..

以下是我运行cpanm --force install JSON时遇到的问题:

!
! Can't write to /Library/Perl/5.18 and /usr/local/bin: Installing modules to /Users/etudiant/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /Library/Perl/5.18 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
--> Working on install
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/install-0.01.tar.gz ... OK
Configuring install-0.01 ... OK
Building and testing install-0.01 ... FAIL
! Installing install failed. See /Users/etudiant/.cpanm/work/1526230657.17102/build.log for details. Retry with --force to force install it.
--> Working on JSON
Fetching http://www.cpan.org/authors/id/I/IS/ISHIGAKI/JSON-2.97001.tar.gz ... OK
Configuring JSON-2.97001 ... OK
Building and testing JSON-2.97001 ... FAIL
! Installing JSON failed. See /Users/etudiant/.cpanm/work/1526230657.17102/build.log for details. Retry with --force to force install it.

1526230657.17102/build.log文件的内容:

more /Users/etudiant/.cpanm/work/1526230657.17102/build.log
cpanm (App::cpanminus) 1.7044 on perl 5.018002 built for darwin-thread-multi-2level
Work directory is /Users/etudiant/.cpanm/work/1526230657.17102
You have make /usr/bin/make
You have LWP 6.05
You have /usr/bin/tar: bsdtar 2.8.3 - libarchive 2.8.3
You have /usr/bin/unzip
!
! Can't write to /Library/Perl/5.18 and /usr/local/bin: Installing modules to /Users/etudiant/perl5
! To turn off this warning, you have to do one of the following:
!   - run me as a root or with --sudo option (to install to /Library/Perl/5.18 and /usr/local/bin)
!   - Configure local::lib in your existing shell to set PERL_MM_OPT etc.
!   - Install local::lib by running the following commands
!
!         cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)
!
Searching install () on cpanmetadb ...
--> Working on install
Fetching http://www.cpan.org/authors/id/D/DA/DAGOLDEN/install-0.01.tar.gz
-> OK
Unpacking install-0.01.tar.gz
Entering install-0.01
Checking configure dependencies from META.yml
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring install-0.01
Running Makefile.PL
Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for install
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Building and testing install-0.01
cp lib/install.pm blib/lib/install.pm
Manifying 1 pod document
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/install.t .. ok
All tests successful.
Files=1, Tests=1,  0 wallclock secs ( 0.03 usr  0.01 sys +  0.02 cusr  0.00 csys =  0.06 CPU)
Result: PASS
Manifying 1 pod document
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/Users/etudiant/perl5/lib/perl5'
Do not have write permissions on '/Users/etudiant/perl5/lib/perl5'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1.
make: *** [pure_site_install] Error 13
-> FAIL Installing install failed. See /Users/etudiant/.cpanm/work/1526230657.17102/build.log for details. Retry with --force to force install it.
Searching JSON () on cpanmetadb ...
--> Working on JSON
Fetching http://www.cpan.org/authors/id/I/IS/ISHIGAKI/JSON-2.97001.tar.gz
-> OK
Unpacking JSON-2.97001.tar.gz
Entering JSON-2.97001
Checking configure dependencies from META.json
Checking if you have ExtUtils::MakeMaker 6.58 ... Yes (7.34)
Configuring JSON-2.97001
Running Makefile.PL
Welcome to JSON (v.2.97001)
=============================

 ** BACKWARD INCOMPATIBILITY **

Since version 2.90, stringification (and string comparison) for
JSON::true and JSON::false has not been overloaded. It shouldn't
matter as long as you treat them as boolean values, but a code that
expects they are stringified as "true" or "false" doesn't work as
you have expected any more.

    if (JSON::true eq 'true') {  # now fails

    print "The result is 1 now."; # => The result is 1 now.

And now these boolean values don't inherit JSON::Boolean, either.
When you need to test a value is a JSON boolean value or not, use
JSON::is_bool function, instead of testing the value inherits
a particular boolean class or not.

Checking if your kit is complete...
Looks good
Generating a Unix-style Makefile
Writing Makefile for JSON
Writing MYMETA.yml and MYMETA.json
-> OK
Checking dependencies from MYMETA.json ...
Checking if you have ExtUtils::MakeMaker 0 ... Yes (7.34)
Checking if you have Test::More 0 ... Yes (0.98)
Building and testing JSON-2.97001
cp lib/JSON/backportPP/Compat5005.pm blib/lib/JSON/backportPP/Compat5005.pm
cp lib/JSON/backportPP/Boolean.pm blib/lib/JSON/backportPP/Boolean.pm
cp lib/JSON/backportPP/Compat5006.pm blib/lib/JSON/backportPP/Compat5006.pm
cp lib/JSON/backportPP.pm blib/lib/JSON/backportPP.pm
cp lib/JSON.pm blib/lib/JSON.pm
Manifying 5 pod documents
PERL_DL_NONLAZY=1 "/usr/bin/perl" "-MExtUtils::Command::MM" "-MTest::Harness" "-e" "undef *Test::Harness::Switches; test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
# JSON::backportPP 2.97001
t/00_backend_version.t ................ ok
t/00_load.t ........................... ok
t/00_load_backport_pp.t ............... ok
t/00_pod.t ............................ ok
t/01_utf8.t ........................... ok
t/02_error.t .......................... ok
t/03_types.t .......................... ok
t/06_pc_pretty.t ...................... ok
t/07_pc_esc.t ......................... ok
t/08_pc_base.t ........................ ok
t/09_pc_extra_number.t ................ ok
t/104_sortby.t ........................ ok
t/105_esc_slash.t ..................... ok
t/106_allow_barekey.t ................. ok
t/107_allow_singlequote.t ............. ok
t/108_decode.t ........................ ok
t/109_encode.t ........................ ok
t/10_pc_keysort.t ..................... ok
t/110_bignum.t ........................ ok
t/112_upgrade.t ....................... ok
t/113_overloaded_eq.t ................. ok
t/114_decode_prefix.t ................. ok
t/115_tie_ixhash.t .................... ok
t/116_incr_parse_fixed.t .............. ok
t/117_numbers.t ....................... ok
t/11_pc_expo.t ........................ ok
t/12_blessed.t ........................ ok
t/13_limit.t .......................... ok
t/14_latin1.t ......................... ok
t/15_prefix.t ......................... ok
t/16_tied.t ........................... ok
t/17_relaxed.t ........................ ok
t/18_json_checker.t ................... ok
t/19_incr.t ........................... ok
t/20_unknown.t ........................ ok
t/21_evans_bugrep.t ................... ok
t/22_comment_at_eof.t ................. ok
t/99_binary.t ......................... ok
t/e00_func.t .......................... ok
t/e01_property.t ...................... ok
# 1
t/e02_bool.t .......................... ok
t/e03_bool2.t ......................... ok
t/e11_conv_blessed_univ.t ............. ok
t/e90_misc.t .......................... ok
t/gh_28_json_test_suite.t ............. ok
t/gh_29_trailing_false_value.t ........ ok
t/rt_116998_wrong_character_offset.t .. ok
t/rt_90071_incr_parse.t ............... ok
t/x00_load.t .......................... ok
t/x02_error.t ......................... ok
t/x12_blessed.t ....................... ok
t/x16_tied.t .......................... ok
t/x17_strange_overload.t .............. ok
t/xe04_escape_slash.t ................. ok
t/xe05_indent_length.t ................ ok
t/xe12_boolean.t ...................... ok
t/xe19_xs_and_suportbypp.t ............ ok
t/xe20_croak_message.t ................ ok
t/xe21_is_pp.t ........................ ok
t/zero-mojibake.t ..................... ok
All tests successful.
Files=60, Tests=3720,  5 wallclock secs ( 0.47 usr  0.16 sys +  4.45 cusr  0.34 csys =  5.42 CPU)
Result: PASS
Manifying 5 pod documents
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
ERROR: Can't create '/Users/etudiant/perl5/lib/perl5'
Do not have write permissions on '/Users/etudiant/perl5/lib/perl5'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
 at -e line 1.
make: *** [pure_site_install] Error 13
-> FAIL Installing JSON failed. See /Users/etudiant/.cpanm/work/1526230657.17102/build.log for details. Retry with --force to force install it.

0 个答案:

没有答案