在窗口 10 中安装 laravel 安装程序时出错

2022-01-21 00:00:00 php composer-php laravel-5.5

我使用的是 Windows 10 并安装了 composer.当我尝试使用此命令全局安装 laravel 安装程序时:

I am using Windows 10 and composer is installed. When I try to install laravel installer globally using this command:

composer global require laravel/installer

[ComposerDownloaderTransportException]
The "https://repo.packagist.org/packages.json" file could not be downloaded: 
failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

这意味着包没有下载.我没有使用任何代理服务器.Composer诊断结果如下:

It means package not downloaded. I am not using any proxy server. Composer diagnose result is listed below:

Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: 
[ComposerDownloaderTransportException] The "http://repo.packagist.org/packages.json" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Checking https connectivity to packagist: 
[ComposerDownloaderTransportException] The "https://repo.packagist.org/packages.json" file could not be downloaded: failed to open stream: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Checking github.com rate limit: FAIL
[ComposerDownloaderTransportException] The 
"https://api.github.com/rate_limit" file could not be downloaded: failed to 
open stream: A connection attempt failed because the connected party did not 
properly respond after a period of time, or established connection failed 
because connected host has failed to respond.

Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952 OK
Checking composer version: OK
Composer version: 1.8.0
PHP version: 7.2.1
PHP binary path: E:xamppphpphp.exe

推荐答案

你有使用杀毒软件吗?如果是,请尝试禁用然后检查.

Do you use any antivirus? If yes try to disable then check.

Mcafe 有时会阻止下载 packagegist.

Sometime Mcafe prevent to download packagist.

相关文章