【问题标题】:XML::Twig fails to install on mac terminalXML::Twig 无法在 mac 终端上安装
【发布时间】:2016-11-15 23:00:26
【问题描述】:

我正在尝试在mac终端上安装twig,但似乎有很多错误如下:

Admins-MBP:~ admin$ cpan install XML::Twig
    CPAN: Storable loaded ok (v2.34)
    Reading '/Users/admin/.cpan/Metadata'
      Database was generated on Mon, 15 Aug 2016 09:17:02 GMT
    CPAN: Time::HiRes loaded ok (v1.9725)
    Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".




        I'll continue, but if you encounter problems, they may be due
        to insufficient permissions.
    CPAN: HTTP::Tiny loaded ok (v0.017)
    Fetching with HTTP::Tiny:
    http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz
    Error downloading with HTTP::Tiny: Error: Could not open temporary file /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123482202692 for downloading: Permission denied
     at /Users/admin/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/CPAN/HTTP/Client.pm line 41.


    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist
        Warning: no success downloading '/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123'. Giving up on it.
    Fetching with HTTP::Tiny:
    http://www.cpan.dk/authors/01mailrc.txt.gz
    Error downloading with HTTP::Tiny: Error: Could not open temporary file /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp221231577050846 for downloading: Permission denied
     at /Users/admin/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/CPAN/HTTP/Client.pm line 41.


    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://www.cpan.dk/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://www.cpan.dk/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist
        Warning: no success downloading '/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123'. Giving up on it.
    Fetching with HTTP::Tiny:
    http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz
    Error downloading with HTTP::Tiny: Error: Could not open temporary file /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123669027792 for downloading: Permission denied
     at /Users/admin/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/CPAN/HTTP/Client.pm line 41.


    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist
        Warning: no success downloading '/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123'. Giving up on it.
    Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".
        I'll continue, but if you encounter problems, they may be due
        to insufficient permissions.

    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist

    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://www.cpan.dk/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://www.cpan.dk/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist

    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist
        Warning: no success downloading '/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123'. Giving up on it.
    Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".
        I'll continue, but if you encounter problems, they may be due
        to insufficient permissions.
    No external ftp command available

    Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".
        I'll continue, but if you encounter problems, they may be due
        to insufficient permissions.
    Fetching with HTTP::Tiny:
    http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz
    Error downloading with HTTP::Tiny: Error: Could not open temporary file /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp221231089200351 for downloading: Permission denied
     at /Users/admin/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/CPAN/HTTP/Client.pm line 41.


    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist
        Warning: no success downloading '/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123'. Giving up on it.
    Fetching with HTTP::Tiny:
    http://www.cpan.dk/authors/01mailrc.txt.gz
    Error downloading with HTTP::Tiny: Error: Could not open temporary file /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp221231652346630 for downloading: Permission denied
     at /Users/admin/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/CPAN/HTTP/Client.pm line 41.


    Trying with
        /usr/bin/curl -L -f -s -S --netrc-optional
    to get
        http://www.cpan.dk/authors/01mailrc.txt.gz
    sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

        Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://www.cpan.dk/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
        returned status 1 (wstat 256)
    Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist
        Warning: no success downloading '/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123'. Giving up on it.
    Fetching with HTTP::Tiny:
    http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz
    Error downloading with HTTP::Tiny: Error: Could not open temporary file /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123742645488 for downloading: Permission denied
     at /Users/admin/perl5/perlbrew/perls/perl-5.16.0/lib/5.16.0/CPAN/HTTP/Client.pm line 41.





Trying with
    /usr/bin/curl -L -f -s -S --netrc-optional
to get
    http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz
sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

函数系统("/usr/bin/curl -L -f -s -S --netrc-optional "http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz" > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz .tmp22123"") 返回状态 1 (wstat 256) 警告:预期文件 [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] 不存在 警告:没有成功下载“/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123”。放弃它。 警告:您不能写入目录“/Users/admin/.cpan/sources/authors”。 我会继续,但如果你遇到问题,他们可能是由于 权限不足。

Trying with
    /usr/bin/curl -L -f -s -S --netrc-optional
to get
    http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz
sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

    Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://cpan.mirrors.uk2.net/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
    returned status 1 (wstat 256)
Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist

Trying with
    /usr/bin/curl -L -f -s -S --netrc-optional
to get
    http://www.cpan.dk/authors/01mailrc.txt.gz
sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

    Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://www.cpan.dk/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
    returned status 1 (wstat 256)
Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist

Trying with
    /usr/bin/curl -L -f -s -S --netrc-optional
to get
    http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz
sh: /Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123: Permission denied

    Function system("/usr/bin/curl -L -f -s -S --netrc-optional "http://mirror.met.hu/CPAN/authors/01mailrc.txt.gz"  > "/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123"")
    returned status 1 (wstat 256)
Warning: expected file [/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123] doesn't exist
    Warning: no success downloading '/Users/admin/.cpan/sources/authors/01mailrc.txt.gz.tmp22123'. Giving up on it.
Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".
    I'll continue, but if you encounter problems, they may be due
    to insufficient permissions.
Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".
    I'll continue, but if you encounter problems, they may be due
    to insufficient permissions.
Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".
    I'll continue, but if you encounter problems, they may be due
    to insufficient permissions.
No external ftp command available

Please check, if the URLs I found in your configuration file
(http://cpan.mirrors.uk2.net/, http://www.cpan.dk/,
http://mirror.met.hu/CPAN/) are valid. The urllist can be edited. E.g. with
'o conf urllist push ftp://myurl/'

Could not fetch authors/01mailrc.txt.gz

【问题讨论】:

  • Warning: You are not allowed to write into directory "/Users/admin/.cpan/sources/authors".
  • @Sobrique 你太棒了!!谢谢,我通过sudo cpan install XML::Twig安装它,我如何检查它是否工作?
  • @LearnerAlgorithm:编程技能的一部分是学习阅读错误信息:-)

标签: macos perl module installation xml-twig


【解决方案1】:

我认为最好不要在系统 perl 中安装该模块。尝试perlbrew 并安装您自己的 perl(如果您需要,可以处理许多不同的 perl)。

然后,轻松切换到适当的 perl,并使用所需的模块(使用 cpan 或 cpanm)对其进行自定义。

【讨论】:

  • 我的问题其实不是这个,看这个帖子stackoverflow.com/questions/40607730/how-can-i-parse-a-xml-file我只需要运行这个脚本,安装树枝后,我又遇到了问题
  • @Miguel Prz 我的名声一点也不差!!!我很欣赏你的回答,但我仍在阅读它,我不喜欢它,因为我的名声很小
猜你喜欢
  • 1970-01-01
  • 2016-03-04
  • 2020-01-10
  • 2018-01-23
  • 1970-01-01
  • 1970-01-01
  • 2012-10-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多