This morning, I ran this command
composer create-project laravel/laravel laravel-4.2 4.2 --prefer-dist
I kept getting
The "https://packagist.org/packages.json" file could not be downloaded: failed to open stream: Operation timed out
Retrying with degraded mode, check https://getcomposer.org/doc/articles/troubleshooting.md#degraded-mode for more info
Anyone know how to avoid this ?
For me, this wasn't an issue with my internet connection speed, but it was a issue with IPv6 resolution of "repo.packagist.org". I got around this issue by adding the IPv4 address to my hosts file. It's a hack, but it works.
# dig +short repo.packagist.org
142.44.164.255
# echo "142.44.164.255 repo.packagist.org" >> /etc/hosts
More details here!
try this solution worked for me!
"repositories": [
{
"type": "composer",
"url": "https://packagist.org"
},
{ "packagist": false }
]
and run composer:update
once again. If not then run composer self-update
I got the answer here and it works like voodoo...
For me it was ipv6, I disabled it using: networksetup -setv6off Wi-Fi
on macOS. Worked like a charm.
Solution found here: https://getcomposer.org/doc/articles/troubleshooting.md#operation-timed-out-ipv6-issues-
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With