我有很多解决方案,但仍然无法解决这个问题。当我运行以下命令时:
composer global require "laravel/installer=~1.1"
我收到此错误:
Changed current directory to C:/Users/Admin/AppData/Roaming/Composer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Installing symfony/console (v2.6.1)
Downloading: 100%
Downloading: 100%
Downloading: 100%
Failed to download symfony/console from dist: The "https://api.github.com/re
pos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8" file could
not be downloaded: php_network_getaddresses: getaddrinfo failed: No such host i
s known.
failed to open stream: php_network_getaddresses: getaddrinfo failed: No such hos
t is known.
Now trying to download from source
- Installing symfony/console (v2.6.1)
Cloning ef825fd9f809d275926547c9e57cbf14968793e8
[RuntimeException]
Failed to clone git@github.com:symfony/Console.git, git was not found, chec
k that it is installed and in your PATH env.
'git' is not recognized as an internal or external command,
operable program or batch file.
require [--dev] [--prefer-source] [--prefer-dist] [--no-progress] [--no-update]
[--update-no-dev] [--update-with-dependencies] [--ignore-platform-reqs] [--sort-
packages] [packages1] ... [packagesN]
我做错了吗??
错误清楚地
显示在抛出的输出中。
[RuntimeException]
Failed to clone git@github.com:symfony/Console.git, git was not found, chec
k that it is installed and in your PATH env.
'git' is not recognized as an internal or external command,
您没有安装 git。在您的系统上安装 git,然后重试。
问题是 DNS -
我使用谷歌DNS而不是我的互联网服务提供商。
这个技巧解决了这个问题。