无法通过作曲家安装laravel

时间:2014-12-30 05:35:58

标签: laravel composer-php command-prompt

我有很多解决方案,但仍无法解决此问题。 当我运行以下命令时:

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]

我做错了什么?

2 个答案:

答案 0 :(得分:2)

错误显示在输出的输出中。

[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,然后重试。

答案 1 :(得分:0)

问题是DNS -

我使用谷歌DNS代替我的互联网服务提供商。

这个技巧解决了这个问题。