skip to Main Content

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.

When I try to downgrade to composer to version 1 with composer self-update --1

[ComposerDownloaderFilesystemException]
  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

I’ve also ran composer update --no-plugins and it returns with the following:

  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

Answers


  1. 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.

    Login or Signup to reply.
  2. 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

    Remove the vendor folder

    Assume you are using composer 2, for Magento 2.4.0 – 2.4.3-P2, run:

    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
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search