0
votes

I'm using Homebrew to run php and composer under OSX. To develop my php applications I use Valet. Everytime I want to require a package or update my installed packages I get this error:

The "https://repo.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

I've tried several solutions (allowing "secure-http":false, changing the repository-url, etc.).

But nothing seems to work global. Using the secure-http flag works sometimes, but the script takes way too long to finish (e.g. installing a new laravel project).

Is there a way to fix this permanently?

1

1 Answers

1
votes

The problem was caused by activated IPv6 in my networksettings for my Wi-Fi connection.

Here is the Link to the composer-website.

Short way to handle it:

  1. deactivate IPv6 for your used connection networksetup -setv6off Wi-Fi
  2. run your composer-commands
  3. reactivate IPv6 for your used connection networksetup -setv6automatic Wi-Fi

If you don't need IPv6 on your machine, you can leave it disabled.