elasticsearch,composer-php,Php,elasticsearch,Composer Php" /> elasticsearch,composer-php,Php,elasticsearch,Composer Php" />

Php 同时安装Composer依赖项

Php 同时安装Composer依赖项,php,elasticsearch,composer-php,Php,elasticsearch,Composer Php,运行composer install以获取弹性搜索时,出现以下错误: Problem 1 - Installation request for tamayo/laravel-scout-elastic 1.0.1 -> satisfiable by tamayo/laravel-scout-elastic[1.0.1]. - tamayo/laravel-scout-elastic 1.0.1 requires elasticsearch/elasticsearch ^

运行composer install以获取弹性搜索时,出现以下错误:

  Problem 1
    - Installation request for tamayo/laravel-scout-elastic 1.0.1 -> satisfiable by tamayo/laravel-scout-elastic[1.0.1].
    - tamayo/laravel-scout-elastic 1.0.1 requires elasticsearch/elasticsearch ^2.2 -> no matching package found.

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.

如何让这些软件包一起安装?

尝试清理Composer的缓存

您的DEP(至少有3个已发布)工作正常,只需将它们安装到我的机器上即可

$ composer show
doctrine/inflector           v1.1.0  Common String Manipulations with regard to casing and singular/plural rules.
elasticsearch/elasticsearch  v2.3.0  PHP Client for Elasticsearch
guzzlehttp/ringphp           1.1.0   Provides a simple API and specification that abstracts away the details of HTTP into a single PHP function.
guzzlehttp/streams           3.0.0   Provides a simple abstraction over streams of data
illuminate/bus               v5.3.23 The Illuminate Bus package.
illuminate/console           v5.3.23 The Illuminate Console package.
illuminate/container         v5.3.23 The Illuminate Container package.
illuminate/contracts         v5.3.23 The Illuminate Contracts package.
illuminate/database          v5.3.23 The Illuminate Database package.
illuminate/pagination        v5.3.23 The Illuminate Pagination package.
illuminate/pipeline          v5.3.23 The Illuminate Pipeline package.
illuminate/queue             v5.3.23 The Illuminate Queue package.
illuminate/support           v5.3.23 The Illuminate Support package.
laravel/scout                v1.1.12 Laravel Scout provides a driver based solution to searching your Eloquent models.
nesbot/carbon                1.21.0  A simple API extension for DateTime.
paragonie/random_compat      v2.0.4  PHP 5.x polyfill for random_bytes() and random_int() from PHP 7
psr/log                      1.0.2   Common interface for logging libraries
react/promise                v2.4.1  A lightweight implementation of CommonJS Promises/A for PHP
symfony/console              v3.1.8  Symfony Console Component
symfony/debug                v3.1.8  Symfony Debug Component
symfony/polyfill-mbstring    v1.3.0  Symfony polyfill for the Mbstring extension
symfony/process              v3.1.8  Symfony Process Component
symfony/translation          v3.2.1  Symfony Translation Component
tamayo/laravel-scout-elastic 1.0.1   Elastic Driver for Laravel Scout
还有我的
composer.json

{
  "require": {
    "laravel/scout": "^1.1",
    "elasticsearch/elasticsearch": "^2.2",
    "tamayo/laravel-scout-elastic": "^1.0"
  }
}

所以我试过了,但仍然不起作用。当我一个接一个地运行composer时,它们安装得很好。问题是在新部署上,当composer安装运行时,正如我在回答中所说的,我无法重现这个问题。让我们先定义复制它的步骤。我的部署是新的,我也点击了
composer安装
。所以从零开始,没有供应商文件夹。在composer.json中运行composer install的这三件事给了我错误。它在我的本地机器和信号量上失败。我没有错误
composer.json
来自答案。Composer安装了软件包。所以我运行了Composer clearcache,需要做什么才能清除它
{
  "require": {
    "laravel/scout": "^1.1",
    "elasticsearch/elasticsearch": "^2.2",
    "tamayo/laravel-scout-elastic": "^1.0"
  }
}