Windows下Composer使用問題

來源:互聯網
上載者:User

標籤:composer   token   windows   問題   

    通常來說,Composer的在Windows下的安裝非常簡單,如下幾步即可完成!cmd下運行命令:

    方案一:curl -s http://getcomposer.org/installer | php , 如果你的curl不能用,也可以使用一下的方案。

    方案二:直接下載軟體來安裝 https://getcomposer.org/Composer-Setup.exe


    然後是更新問題:只需要在cmd下再運行如下命令:

    php composer.phar self-update


    然後你可能在更新或者是執行composer過程中遇到下面的問題

    1.Could not fetch https://api.github.com/repos/jquery/jquery, enter your GitHub cr
edentials to go over the API rate limit
    The credentials will be swapped for an OAuth token stored in C:/Users/idiot/AppD
ata/Roaming/Composer/auth.json, your password will not be stored
    To revoke access to this token you can visit https://github.com/settings/applica
tions
    Username: 

    2.Your github oauth token for github.com contains invalid characters: ""


    這裡的錯誤是因為你的github的token值無效或者失效,需要你新增一個token。


    解決方案

    1.首先你要更新到最新版本:php composer.phar self-update

    2.登入到Github https://github.com/settings/applications “generated a token”增加一個新的Token

    3.運行cmd  php composer.phar config -g github-oauth.github.com token (token值為你新增的)


    這樣就解決掉問題了,哈哈 !

本文出自 “Shows technology” 部落格,請務必保留此出處http://wangzhijun.blog.51cto.com/9660708/1639859

Windows下Composer使用問題

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.