0

I used this command to create a new laravel project in the homestead:

composer create-project laravel/laravel Laravel

Then, the terminal show this error:

Failed to download laravel/laravel from dist: The "https://api.github.com/repos/laravel/laravel/zipball/7bddbdc2a1f8d9c23205707e74455d74684e3031" file could not be downloaded: failed to open stream: Connection timed out Now trying to download from source

I used curl command to get the content, failed again:

curl https://api.github.com/repos/laravel/laravel/zipball/7bddbdc2a1f8d9c23205707e74455d74684e3031

However, when I enter the address in the broswer(Firefox), it work! I can download the file by the browser!

Any help is greatly appreciated.

Luthando Ntsekwa
  • 4,192
  • 6
  • 23
  • 52
  • possible duplicate of [curl command cannot get contents from api.github, but the network is fine](http://stackoverflow.com/questions/30727753/curl-command-cannot-get-contents-from-api-github-but-the-network-is-fine) – toesslab Jun 09 '15 at 10:08
  • Why are you asking exactly the same question 2 times?? – toesslab Jun 09 '15 at 20:34

1 Answers1

0

This is probably the common issue about the reliability of the github downloads. It fails regularly.

A workaround is to increase COMPOSER_PROCESS_TIMEOUT (defaults to 300) and force installing from source with the --prefer-source option:

COMPOSER_PROCESS_TIMEOUT=2000

composer create-project laravel/laravel Laravel --prefer-source
Limon Monte
  • 52,539
  • 45
  • 182
  • 213
  • stoped at command: `Executing command (CWD): git clone --no-checkout 'git://github.com/laravel/laravel.git' 'blog/' && cd 'blog/' && git remote add composer 'git://github.com/laravel/laravel.git' && git fetch composer` – cirCavalier Jun 09 '15 at 10:02
  • @cirCavalier can you please try to replace `--prefer-source` with `--prefer-dist` and try again: `composer create-project laravel/laravel Laravel --prefer-dist` – Limon Monte Jun 09 '15 at 10:05
  • sir, I enter this command `composer create-project laravel/laravel Laravel --prefer-dist -vvv` it shows json files from packagist.org written successfully, but failed downloading from api.github.com, there is the full report: `Downloading https://api.github.com/repos/laravel/laravel/zipball/7bddbdc2a1f8d9c23205707e74455d74684e3031 Downloading: 100% Download failed, retrying...` – cirCavalier Jun 09 '15 at 10:10
  • just updated my answer, I think it should work now :) – Limon Monte Jun 09 '15 at 10:17
  • all right, i will try this during my dinner. But, still one question, I have try to enter https://api.github.com/repos/laravel/laravel/zipball/7bddbdc2a1f8d9c23205707e744‌​55d74684e3031 in my browser, it can download the file very fast, does this really github's reliability question? – cirCavalier Jun 09 '15 at 10:26