1

Trying to install M2 using Composer with the following:

composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition /var/www/m2

PHP:

PHP 7.4.12 (cli) (built: Oct 31 2020 17:04:09) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
    with Zend OPcache v7.4.12, Copyright (c), by Zend Technologies

Composer:

Composer version 1.1.1 2016-05-17 12:25:44

This is the output:

Installing magento/project-community-edition (2.4.1)
Deprecation Notice: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in phar:///usr/bin/composer/src/Composer/Downloader/GitDownloader.php:238
Deprecation Notice: The behavior of unparenthesized expressions containing both '.' and '+'/'-' will change in PHP 8: '+'/'-' will take a higher precedence in phar:///usr/bin/composer/src/Composer/Downloader/SvnDownloader.php:132
  - Installing magento/project-community-edition (2.4.1)
    Downloading: 100%

Created project in /var/www/m2
Loading composer repositories with package information
Warning from https://packagist.org: You are using an outdated version of Composer. Composer 2.0 is now available and you should upgrade. See https://getcomposer.org/2
Updating dependencies (including require-dev)


  [ErrorException]
  "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?


create-project [-s|--stability STABILITY] [--prefer-source] [--prefer-dist] [--repository REPOSITORY] [--repository-url REPOSITORY-URL] [--dev] [--no-dev] [--no-custom-installers] [--no-scripts] [--no-progress] [--no-secure-http] [--keep-vcs] [--no-install] [--ignore-platform-reqs] [--] [<package>] [<directory>] [<version>]
2
  • Just update composer to 1.10.17 , how to do that you can check on composer website
    – BartZalas
    Nov 18 '20 at 21:25
  • 1
    @BartZalas this appeared to work. provide it as an answer so I can accept? did I miss a requirement note on the magento site? this seems like a pretty specific version requirement for composer! Nov 19 '20 at 11:36
0

Update composer to 1.10.17 this should fix the issue.

This and few different errors are caused because of that.   I use ubuntu, latest version of composer avalible was - 1.6.3 I think.

So I do:

sudo apt remove composer


php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

 

php -r "if (hash_file('sha384', 'composer-setup.php') === '756890a4488ce9024fc62c56153228907f1545c228516cbf63f885e036d37e9a59d27d63f46af1d4d07ee0f76181c7d3') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"



sudo php composer-setup.php --version=1.10.17 --install-dir=/usr/bin --filename=composer 

Check version:

composer --version

 Remove all vendor and cache:

rm -rf vendor/*

composer clear-cache

composer update

Ref:

https://getcomposer.org/download/

https://community.magento.com/t5/Magento-2-x-Version-Upgrades/Error-during-Upgrade-from-2-3-3-to-2-3-5/m-p/463059#M3957

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.