http://www.perlmonks.org?node_id=1079238

pno has asked for the wisdom of the Perl Monks concerning the following question:

Hello Dear Monks,

I'm trying to install Net::Daemon. It requires JSON 2.5 As you can see below JSON 2.90 is installed (should be compatible with 2.5). Did you encounter this issue and solved it somehow? I'm using ActiveState perl 5.18.2

cpan> install Net::Daemon Running install for module 'Net::Daemon' Running make for M/MN/MNOONING/Net-Daemon-0.48.tar.gz Checksum for C:\Software\Perl5.18\cpan\sources\authors\id\M\MN\MNOONIN +G\Net-Daemon-0.48.tar.gz ok Net-Daemon-0.48/ Net-Daemon-0.48/ChangeLog Net-Daemon-0.48/lib/ Net-Daemon-0.48/lib/Net/ Net-Daemon-0.48/lib/Net/Daemon/ Net-Daemon-0.48/lib/Net/Daemon/Log.pm Net-Daemon-0.48/lib/Net/Daemon/Test.pm Net-Daemon-0.48/lib/Net/Daemon.pm Net-Daemon-0.48/Makefile.PL Net-Daemon-0.48/MANIFEST Net-Daemon-0.48/MANIFEST.SKIP Net-Daemon-0.48/META.yml Net-Daemon-0.48/README Net-Daemon-0.48/regexp-threads Net-Daemon-0.48/t/ Net-Daemon-0.48/t/base.t Net-Daemon-0.48/t/config.t Net-Daemon-0.48/t/fork.t Net-Daemon-0.48/t/forkm.t Net-Daemon-0.48/t/ithread.t Net-Daemon-0.48/t/ithreadm.t Net-Daemon-0.48/t/loop-child.t Net-Daemon-0.48/t/loop.t Net-Daemon-0.48/t/server Net-Daemon-0.48/t/single.t Net-Daemon-0.48/t/thread.t Net-Daemon-0.48/t/threadm.t Net-Daemon-0.48/t/unix.t CPAN.pm: Building M/MN/MNOONING/Net-Daemon-0.48.tar.gz Checking if your kit is complete... Looks good JSON 2.5 is required for $ENV{PERL_JSON_BACKEND} = 'JSON::XS' at c:/Software/Perl5.18/lib/CPAN/Meta/Converter.pm line 23. at c:/Software/Perl5.18/lib/ExtUtils/MM_Any.pm line 884. JSON 2.5 is required for $ENV{PERL_JSON_BACKEND} = 'JSON::XS' at c:/Software/Perl5.18/lib/CPAN/Meta/Converter.pm line 23. Warning: No success on command[c:\Software\Perl5.18\bin\perl.exe Makef +ile.PL INSTALLDIRS=site] MNOONING/Net-Daemon-0.48.tar.gz c:\Software\Perl5.18\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NO +T OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Failed during this command: MNOONING/Net-Daemon-0.48.tar.gz : writemakefile NO 'c:\S +oftware\Perl5.18\bin\perl.exe Makefile.PL INSTALLDIRS=site' returned +status 512 cpan> install JSON JSON is up to date (2.90). cpan>

Replies are listed 'Best First'.
Re: JSON 2.5 2.90
by ikegami (Patriarch) on Mar 21, 2014 at 14:00 UTC

    What do you get from the following:

    perl -e"use JSON; JSON->VERSION(2.5);"

    (A failure in that code is what leads to the error you get.)

      perl.exe -e "use JSON; JSON->VERSION(2.5);" Can't locate JSON/XS.pm in @INC (you may need to install the JSON::XS +module) (@INC contains: c:/Software/Perl5.18/site/lib c:/Software/Per +l5.18/lib .) at (eval 4) line 2. BEGIN failed--compilation aborted at (eval 4) line 2. at -e line 1. Compilation failed in require at -e line 1. BEGIN failed--compilation aborted at -e line 1.
        You are explicitly requesting that JSON uses JSON::XS instead of JSON::PP (by setting env var PERL_JSON_BACKEND to JSON::XS), but you don't have JSON::XS installed.
Re: JSON 2.5 2.90
by Khen1950fx (Canon) on Mar 21, 2014 at 15:04 UTC
    You could change the environmental variable. What happens when you try this?
    PERL_JSON_BACKEND='JSON::XS,JSON::PP' cpan Net::Daemon
      c:\Software\Perl5.18\bin\cpan Net::Daemon CPAN: Term::ANSIColor loaded ok (v4.02) CPAN: Storable loaded ok (v2.45) Reading 'C:\Software\Perl5.18\cpan\Metadata' Database was generated on Thu, 20 Mar 2014 10:41:02 GMT Reading 'C:\Software\Perl5.18\cpan\sources\authors\01mailrc.txt.gz' CPAN: Compress::Zlib loaded ok (v2.063) ...................................................................... +......DONE CPAN: LWP::UserAgent loaded ok (v6.05) CPAN: Time::HiRes loaded ok (v1.9726) Fetching with LWP: http://ppm.activestate.com/CPAN/modules/02packages.details.txt.gz CPAN: YAML::XS loaded ok (v0.41) Reading 'C:\Software\Perl5.18\cpan\sources\modules\02packages.details. +txt.gz' Database was generated on Sun, 23 Mar 2014 11:06:14 GMT ...................................................................... +......DONE Fetching with LWP: http://ppm.activestate.com/CPAN/modules/03modlist.data.gz Reading 'C:\Software\Perl5.18\cpan\sources\modules\03modlist.data.gz' ...................................................................... +......DONE Writing C:\Software\Perl5.18\cpan\Metadata Running install for module 'Net::Daemon' Running make for M/MN/MNOONING/Net-Daemon-0.48.tar.gz CPAN: Digest::SHA loaded ok (v5.85) Checksum for C:\Software\Perl5.18\cpan\sources\authors\id\M\MN\MNOONIN +G\Net-Daemon-0.48.tar.gz ok CPAN: Archive::Tar loaded ok (v1.96) Net-Daemon-0.48/ Net-Daemon-0.48/ChangeLog Net-Daemon-0.48/lib/ Net-Daemon-0.48/lib/Net/ Net-Daemon-0.48/lib/Net/Daemon/ Net-Daemon-0.48/lib/Net/Daemon/Log.pm Net-Daemon-0.48/lib/Net/Daemon/Test.pm Net-Daemon-0.48/lib/Net/Daemon.pm Net-Daemon-0.48/Makefile.PL Net-Daemon-0.48/MANIFEST Net-Daemon-0.48/MANIFEST.SKIP Net-Daemon-0.48/META.yml Net-Daemon-0.48/README Net-Daemon-0.48/regexp-threads Net-Daemon-0.48/t/ Net-Daemon-0.48/t/base.t Net-Daemon-0.48/t/config.t Net-Daemon-0.48/t/fork.t Net-Daemon-0.48/t/forkm.t Net-Daemon-0.48/t/ithread.t Net-Daemon-0.48/t/ithreadm.t Net-Daemon-0.48/t/loop-child.t Net-Daemon-0.48/t/loop.t Net-Daemon-0.48/t/server Net-Daemon-0.48/t/single.t Net-Daemon-0.48/t/thread.t Net-Daemon-0.48/t/threadm.t Net-Daemon-0.48/t/unix.t CPAN: File::Temp loaded ok (v0.2304) CPAN: Parse::CPAN::Meta loaded ok (v1.4409) CPAN: CPAN::Meta loaded ok (v2.132830) CPAN: Module::CoreList loaded ok (v3.03) CPAN.pm: Building M/MN/MNOONING/Net-Daemon-0.48.tar.gz Checking if your kit is complete... Looks good Could not load PERL_YAML_BACKEND 'YAML' at C:/Software/Perl5.18/lib/CPAN/Meta.pm line 320. Warning: No success on command[C:\Software\Perl5.18\bin\perl.exe Makef +ile.PL INSTALLDIRS=site] MNOONING/Net-Daemon-0.48.tar.gz C:\Software\Perl5.18\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NO +T OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Could not read metadata file. Falling back to other methods to determi +ne prerequisites
        Could not load PERL_YAML_BACKEND 'YAML'
        There are two ways around this, one is to simply unset that environment variable (PERL_YAML_BACKEND) and the other is to install YAML.
Re: JSON 2.5 2.90
by Bloodnok (Vicar) on Mar 21, 2014 at 11:44 UTC
    It's always a good idea to ensure that the title provides a fairly accurate precis of the knowledge &/or wisdom that you seek.

    Have you tried the AS Net::Daemon PPM ?

    A user level that continues to overstate my experience :-))
Re: JSON 2.5 2.90
by stefbv (Curate) on Mar 21, 2014 at 11:55 UTC

    Try "install JSON::XS".

    Update: Fixed typo, thank you hazylife.

      cpan> install JSON::XS Reading 'C:\Software\Perl5.18\cpan\Metadata' Database was generated on Sun, 23 Mar 2014 11:06:14 GMT Running install for module 'JSON::XS' Running make for M/ML/MLEHMANN/JSON-XS-3.01.tar.gz Checksum for C:\Software\Perl5.18\cpan\sources\authors\id\M\ML\MLEHMAN +N\JSON-XS-3.01.tar.gz ok Scanning cache C:\Software\Perl5.18/cpan/build for sizes ...................................................................... +......DONE JSON-XS-3.01/ JSON-XS-3.01/typemap JSON-XS-3.01/XS.pm JSON-XS-3.01/Makefile.PL JSON-XS-3.01/META.yml JSON-XS-3.01/Changes JSON-XS-3.01/META.json JSON-XS-3.01/COPYING JSON-XS-3.01/XS.xs JSON-XS-3.01/README JSON-XS-3.01/bin/ JSON-XS-3.01/bin/json_xs JSON-XS-3.01/eg/ JSON-XS-3.01/eg/bench JSON-XS-3.01/t/ JSON-XS-3.01/t/18_json_checker.t JSON-XS-3.01/t/20_faihu.t JSON-XS-3.01/t/03_types.t JSON-XS-3.01/t/09_pc_extra_number.t JSON-XS-3.01/t/21_evans.t JSON-XS-3.01/t/19_incr.t JSON-XS-3.01/t/52_object.t JSON-XS-3.01/t/05_dwiw_decode.t JSON-XS-3.01/t/00_load.t JSON-XS-3.01/t/07_pc_esc.t JSON-XS-3.01/t/15_prefix.t JSON-XS-3.01/t/06_pc_pretty.t JSON-XS-3.01/t/22_comment_at_eof.t JSON-XS-3.01/t/02_error.t JSON-XS-3.01/t/01_utf8.t JSON-XS-3.01/t/10_pc_keysort.t JSON-XS-3.01/t/17_relaxed.t JSON-XS-3.01/t/11_pc_expo.t JSON-XS-3.01/t/99_binary.t JSON-XS-3.01/t/12_blessed.t JSON-XS-3.01/t/16_tied.t JSON-XS-3.01/t/08_pc_base.t JSON-XS-3.01/t/14_latin1.t JSON-XS-3.01/t/04_dwiw_encode.t JSON-XS-3.01/t/13_limit.t JSON-XS-3.01/XS/ JSON-XS-3.01/XS/Boolean.pm JSON-XS-3.01/MANIFEST CPAN.pm: Building M/ML/MLEHMANN/JSON-XS-3.01.tar.gz Checking if your kit is complete... Looks good Warning: prerequisite Types::Serialiser 0 not found. Warning: prerequisite common::sense 0 not found. JSON 2.5 is required for $ENV{PERL_JSON_BACKEND} = 'JSON::XS' at C:/Software/Perl5.18/lib/CPAN/Meta/Converter.pm line 23. at C:/Software/Perl5.18/lib/ExtUtils/MM_Any.pm line 884. JSON 2.5 is required for $ENV{PERL_JSON_BACKEND} = 'JSON::XS' at C:/Software/Perl5.18/lib/CPAN/Meta/Converter.pm line 23. Warning: No success on command[C:\Software\Perl5.18\bin\perl.exe Makef +ile.PL INSTALLDIRS=site] MLEHMANN/JSON-XS-3.01.tar.gz C:\Software\Perl5.18\bin\perl.exe Makefile.PL INSTALLDIRS=site -- NO +T OK Running make test Make had some problems, won't test Running make install Make had some problems, won't install Could not read metadata file. Falling back to other methods to determi +ne prerequisites Failed during this command: MLEHMANN/JSON-XS-3.01.tar.gz : writemakefile NO 'C:\S +oftware\Perl5.18\bin\perl.exe Makefile.PL INSTALLDIRS=site' returned +status 512 cpan>

        JSON::XS requires JSON, so cpan is trying to load JSON to make sure you have it. You have configured JSON to use JSON::XS which isn't installed, so JSON doesn't load.

        The solution is to stop telling JSON to use JSON::XS until you've installed JSON::XS. The following installed JSON::XS, after which you'll be fine:

        PERL_JSON_BACKEND= cpan JSON::XS
Re: JSON 2.5 2.90
by ww (Archbishop) on Mar 21, 2014 at 11:45 UTC
    "should be compatible with 2.5)"

    Is that assertion based on some knowledge or merely a supposition?


    Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
    1. code
    2. verbatim error and/or warning messages
    3. a coherent explanation of what "doesn't work actually means.

      My assupmption.

        ... and do you know why "assumptions" are dangerous?
              'Because "to assume" makes an ass of you and me.'

        Questions containing the words "doesn't work" (or their moral equivalent) will usually get a downvote from me unless accompanied by:
        1. code
        2. verbatim error and/or warning messages
        3. a coherent explanation of what "doesn't work actually means.