当前位置: 首页 > 知识库问答 >
问题:

安装Laravel-Scout-Relastic版本错误

周祺
2023-03-14

我想在我的laravel 5.7.11应用程序中使用elasticsearch,并进行了一些搜索,我发现了插件laravel-scout-relastic(https://github.com/ericktamayo/laravel-scout-relastic)。我首先尝试了elasticsearch/elasticsearch和laravel-scout-relastic插件,然后最后显示错误:

$ composer require elasticsearch/elasticsearch
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Using version ^6.0 for elasticsearch/elasticsearch
./composer.json has been updated
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 0 updates, 0 removals
  - Installing react/promise (v2.7.0): Downloading (100%)         
  - Installing guzzlehttp/streams (3.0.0): Downloading (100%)         
  - Installing guzzlehttp/ringphp (1.1.1): Downloading (100%)         
  - Installing elasticsearch/elasticsearch (v6.0.1): Downloading (100%)         
Writing lock file
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
Discovered Package: aloha/twilio
Discovered Package: barryvdh/laravel-debugbar
Discovered Package: beyondcode/laravel-dump-server
Discovered Package: cviebrock/eloquent-sluggable
Discovered Package: davejamesmiller/laravel-breadcrumbs
Discovered Package: fideloper/proxy
Discovered Package: intervention/image
Discovered Package: itsgoingd/clockwork
Discovered Package: jrean/laravel-user-verification
Discovered Package: laravel/tinker
Discovered Package: laravelcollective/html
Discovered Package: mews/captcha
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Discovered Package: orangehill/iseed
Discovered Package: proengsoft/laravel-jsvalidation
Discovered Package: rap2hpoutre/laravel-log-viewer
Discovered Package: spatie/laravel-activitylog
Discovered Package: spatie/laravel-tags
Discovered Package: spatie/laravel-translatable
Discovered Package: themsaid/laravel-mail-preview
Discovered Package: unisharp/laravel-filemanager
Discovered Package: xethron/migrations-generator
Discovered Package: yajra/laravel-datatables-oracle
Package manifest generated successfully.
> php artisan vendor:publish --provider="Proengsoft\JsValidation\JsValidationServiceProvider" --tag=public --force
Copied Directory [/vendor/proengsoft/laravel-jsvalidation/public] To [/public/vendor/jsvalidation]
Publishing complete.
serge@serge:/mnt/_work_sdb8/wwwroot/lar/Votes$ composer require tamayo/laravel-scout-elastic
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Using version ^4.0 for tamayo/laravel-scout-elastic
./composer.json has been updated
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/files/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/serge/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Can only install one of: elasticsearch/elasticsearch[5.0.x-dev, v6.0.1].
    - Can only install one of: elasticsearch/elasticsearch[v6.0.1, 5.0.x-dev].
    - Can only install one of: elasticsearch/elasticsearch[5.0.x-dev, v6.0.1].
    - tamayo/laravel-scout-elastic 4.0.0 requires elasticsearch/elasticsearch ^5.0 -> satisfiable by elasticsearch/elasticsearch[5.0.x-dev].
    - Installation request for tamayo/laravel-scout-elastic ^4.0 -> satisfiable by tamayo/laravel-scout-elastic[4.0.0].
    - Installation request for elasticsearch/elasticsearch (locked at v6.0.1, required as ^6.0) -> satisfiable by elasticsearch/elasticsearch[v6.0.1].

你能告诉我哪些版本的我有安装和如何?我的意思是如果我必须在控制台命令中设置包的版本?

请显示这些命令得格式...

# php -v
PHP 7.2.10-0ubuntu0.18.04.1 (cli) (built: Sep 13 2018 13:45:02) ( NTS )

谢谢!

共有1个答案

鲁炳
2023-03-14

必须首先通过以下命令安装Scout:

composer require laravel/scout "5.0.x-dev"
 类似资料:
  • 简介 Laravel Scout 为 Eloquent 模型 全文搜索提供了简单的,基于驱动的解决方案。通过使用模型观察者,Scout 会自动同步 Eloquent 记录的搜索索引。 目前,Scout 自带一个 Algolia 驱动;不过,编写自定义驱动很简单, 你可以轻松的通过自己的搜索实现来扩展 Scout。 安装 首先,通过 Composer 包管理器来安装 Scout: composer

  • 现在如果我用这个命令 它将创建一个具有最新版本(如5.2)的laravel项目,但是如果我想安装一个特定的版本(如5.1版),该怎么办? 更新::我正在寻找laravel安装程序命令,是否有任何选项/参数用于特定版本的安装?

  • 一旦我尝试在Windows上安装Laravel版本5.2,它显示错误。其他较新版本正在成功安装。 我有一个PHP版本5.6。40和作曲家已安装。 警告:需要(C:\xampp\htdocs\Media\bootstrap/.../供应商/autoload.php):无法打开流:第17行的C:\xampp\htdocs\Media\bootstrap\autoload.php中没有这样的文件或目录

  • 运行此命令时,无法安装Laravel 6.0: 我想安装,但它附带。 如何下载laravel的最新版本?我的版本是

  • Laravel Scout Elasticsearch Driver This package provides a Elasticsearch driver for Laravel Scout. Contents Installation Usage Credits License Installation You can install the package via composer: co

  • TNTSearch Driver for Laravel Scout - Laravel 5.3 - 8.0 This package makes it easy to add full text search support to your models with Laravel 5.3 to 8.0. Premium products If you find TNT Search to be