“https://packagist.org/packages.json” file could not be downloaded

后端 未结 5 1130
南方客
南方客 2020-12-20 13:08

I am trying to install a new laravel instance with the following command:

composer create-project laravel/larevel authii --prefer-dist

But

相关标签:
5条回答
  • 2020-12-20 13:36

    I noticed that this also happens when changing the networks. If I put the comüputer to sleep and then continue connected to other networks this happens. So either restart the computer or your docker. Seems to work for me. Had the issue 2 times already.

    0 讨论(0)
  • 2020-12-20 13:37

    Linux users can run this command to resolve this issue:

    sudo sh -c "echo 'precedence ::ffff:0:0/96 100' >> /etc/gai.conf"
    

    More Information

    0 讨论(0)
  • 2020-12-20 13:39

    You need to tell composer to use a proxy.

    Linke here: PHP Composer behind http proxy and Composer cannot download files

    Like:

    export HTTP_PROXY="http://my-corp-proxy.mcdonalds"
    php composer.phar install
    
    0 讨论(0)
  • 2020-12-20 13:41

    For windows user open cmd and put this command

    set http_proxy= xxx.xxx.xxx.xxx:xxxx (YOUR_IP:PORT)
    set https_proxy= xxx.xxx.xxx.xxx:xxxx (YOUR_IP:PORT)
    
    0 讨论(0)
  • 2020-12-20 13:45

    The fix for me was found here: https://getcomposer.org/doc/articles/troubleshooting.md#operation-timed-out-ipv6-issues-.

    I had to disable IPv6 on my network interfaces. After disabling that, composer worked fine.

    0 讨论(0)
提交回复
热议问题