简体   繁体   English

无法将 composer 降级到版本 1,也无法在 Magento 2.4.0 上安装 elasticsuite

[英]Can't downgrade composer to version 1 and can't install elasticsuite on Magento 2.4.0

I'm trying to install elasticsuite 2.10.1 on Magento 2.4 but I need to downgrade my composer to version 1 but I keep getting stuck.我正在尝试在 Magento 2.4 上安装 elasticsuite 2.10.1,但我需要将我的作曲家降级到版本 1,但我一直卡住。

When I try to downgrade to composer to version 1 with composer self-update --1当我尝试使用composer self-update --1将 composer 降级到版本 1

[Composer\Downloader\FilesystemException]
  Filesystem exception:
  Composer update failed: "/usr/local/bin/composer" could not be written.
  rename(/home/usr/.cache/composer/composer-temp7912166.phar,/usr/local/bin/composer): Permission denied

Adding sudo results in sudo: composer: command not found I've also installed composer globally and moved the .phar file to /usr/local/bin/composer在 sudo 中添加sudo结果sudo: composer: command not found我还全局安装了 composer 并将.phar文件移动到/usr/local/bin/composer

I've also ran composer update --no-plugins and it returns with the following:我还运行了composer update --no-plugins并返回以下内容:

  Problem 1
    - Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
    - dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint.
  Problem 2
    - laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4] require composer-plugin-api ^1.1 -> found composer-plugin-api[2.1.0] but it does not match the constraint.
    - magento/product-community-edition 2.4.0 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4].
    - Root composer.json requires magento/product-community-edition 2.4.0 -> satisfiable by magento/product-community-edition[2.4.0].

I've tried googling for answers and no luck for the last 2 hours, I'm out of ideas on how to resolve the problem我试过用谷歌搜索答案,过去 2 小时没有运气,我对如何解决问题一无所知

If you really want to use Composer v1 (which is deprecated and won't be around forever,), you need to run the downgrade with sudo in front to avoid permission problems.如果您真的想使用 Composer v1(已弃用并且不会永远存在),您需要在前面使用sudo运行降级以避免权限问题。

The following works for me:以下对我有用:

First, check the requirement for composer and php version here: https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html First, check the requirement for composer and php version here: https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html

Remove the vendor folder删除供应商文件夹

Assume you are using composer 2, for Magento 2.4.0 - 2.4.3-P2, run:假设您使用的是 composer 2,对于 Magento 2.4.0 - 2.4.3-P2,运行:

sudo composer self-update --1

Run the followings:运行以下命令:

sudo yum install php php-{pear,cgi,common,ctype,curl,fileinfo,mbstring,gd,hash,iconv,sockets,sodium,tokenizer,xmlwriter,xsl,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap,dom,simplexml,soap,libxml,openssl}

sudo composer install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM