无法安装/要求 ongr/elasticsearch-bundle "~5.0" 按照 github 示例。
我正在运行最新symfony的全新安装。
我正在运行以下命令: 作曲家需要 ongr/elasticsearch-bundle "~5.0">
根据 https://github.com/ongr-io/ElasticsearchBundle
composer require ongr/elasticsearch-bundle "~5.0"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "4.2.*"
Package operations: 7 installs, 0 updates, 0 removals
- Installing react/promise (v2.7.1): Loading from cache
- Installing guzzlehttp/streams (3.0.0): Loading from cache
- Installing guzzlehttp/ringphp (1.1.1): Loading from cache
- Installing elasticsearch/elasticsearch (v5.5.0): Loading from cache
- Installing ongr/elasticsearch-dsl (v5.0.6): Loading from cache
- Installing symfony/templating (v4.2.11): Loading from cache
- Installing ongr/elasticsearch-bundle (v5.2.4): Loading from cache
Writing lock file
Generating autoload files
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Symfony operations: 1 recipe (c91982d16a3859d0a43fd4ff85aa437a)
- Configuring ongr/elasticsearch-bundle (>=v5.2.4): From auto-generated recipe
Executing script cache:clear [KO]
[KO]
Script cache:clear returned with error code 1
!!
!! In ArrayNode.php line 228:
!!
!! The child node "managers" at path "ongr_elasticsearch" must be configured.
!!
!!
!!
Script @auto-scripts was called via post-update-cmd
Installation failed, reverting ./composer.json to its original content.
我该怎么做才能解决这个问题?
本教程提到了一个config.yml(我没有(,如果安装过程中不存在,我认为这将创建
假设您的composer.json
文件中有一个部分如下所示:
"scripts": {
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
},
您应该删除"cache:clear": "symfony-cmd"
行。如果它看起来不完全像这样,只需删除所有包含cache:clear
的行。您可能希望在成功安装和配置ongr/elasticsearch-bundle
后恢复此行/这些行,这样您就不必记住在安装与Symfony Flex更兼容的捆绑包后手动清除缓存,或者不要成为其过度热心的受害者试图提供帮助。
或者,这可能是一个更好的解决方案 - 完全摆脱symfony/flex
。当某些第三方向配方添加命令而不检查是否满足所有要求时,它有一个令人讨厌的习惯,即弄乱您的配置文件。我知道,我去过那里。
--no-scripts
选项在开始时绕过 cache:clear,只需将其与知识一起使用,因为绕过缓存清除可能会在启动应用程序时从旧用途中产生常规缓存问题。