network is fine, but cannot create laravel project and show error in the command

北城以北 提交于 2019-12-25 05:33:31

问题


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.


回答1:


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


来源:https://stackoverflow.com/questions/30728079/network-is-fine-but-cannot-create-laravel-project-and-show-error-in-the-command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!