2016-11-15 89 views
-2

我試圖MAC終端上安裝樹枝,但它似乎有很多錯誤如下:XML ::嫩枝無法安裝Mac終端上

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 -option「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 
+0

'警告:您不允許寫入目錄「/Users/admin/.cpan/sources/authors」.' – Sobrique

+0

@Sobrique你很棒!謝謝,我安裝了'sudo cpan install XML :: Twig'如何檢查它是否工作? –

+2

@LearnerAlgorithm:編程技巧的一部分是學習讀取錯誤信息:-) –

回答

0

我認爲最好不要將該模塊安裝到您的系統中。嘗試perlbrew並安裝你自己的perl(並且如果你需要它可以處理許多不同的perls)。

然後,輕鬆切換到正確的perl,並使用所需的模塊(使用cpan或cpanm)對其進行自定義。

+0

我的問題其實不是這個,看看這篇文章http://stackoverflow.com/questions/40607730/how-cani-i- parse-a-xml-file我只需要運行這個腳本,安裝樹枝後,我再次面臨問題 –

+0

@Miguel Prz我的聲望是小投票!我很欣賞你的答案,但是我仍然在閱讀它,我不能喜歡它,因爲我的聲望很低 –