Skip to main content
76 votes
Accepted

How to install a specific Magento 2 version with Composer?

You can try below command: composer create-project --repository-url=https://repo.magento.com/ magento/project-community-edition=2.1.7 /installation/directory/path
Jarnail S's user avatar
  • 4,707
46 votes

Magento 2.4.1 setup:install problem : "the default website isn't defined. Set the website and try again."

It appears that this error might appear when a MySQL database is empty, but the env.php file is present. (Possibly because you had setup Magento, but for some reason, database was deleted.) To fix ...
Aleksandrs Rivkinds's user avatar
31 votes

M2.4 Exception throwing while executing composer require: Higher matching version 2.3.x of xxx/module-xxxx was found in public repository packagist

When you have a module with a same name at packagist.org and at magento marketplace, and the first is newer than the second, this error will happen. This is caused by magento/composer-dependency-...
Ricardo Martins's user avatar
24 votes
Accepted

Magento 2.1.1 not compatibile with PHP 7.1.0

Update - September 2017: Magento 2.2 now officially supports PHP 7.1, so that's the Magento version you should aim for from now on if PHP 7.1 is something you want or need on your platform. Original ...
TiEul's user avatar
  • 1,297
17 votes
Accepted

ReflectionException error on Magento 2

It seems that this module need a special library. If we take a look into the composer.json file located in the module files we can find that he required this library : "require" : { "ebizmarts/...
Alin Lupoiu's user avatar
  • 2,672
16 votes

How to update Magento2 using composer

When upgrading through composer, you can choose the version of which you need to upgrade via a composer upgrade. For example: composer require magento/product-community-edition 2.1.2 --no-update The ...
Richard Cripps's user avatar
16 votes
Accepted

Explanation of app/code vs vendor directories please

Magento 2 advocates the use of composer for managing modules, when you install a module through composer it is added to vendor/<vendor-name>/<module>. You should not edit any code inside ...
oscarpas's user avatar
  • 920
14 votes

Magento 2.4.1 setup:install problem : "the default website isn't defined. Set the website and try again."

I was changing a db and removing env.php helped to get rid of the error for me.
jekabs's user avatar
  • 318
12 votes

Install extension using composer Magento 2

Follow below steps to install magento2 extension (2.1.7) cd <your Magento install dir> composer require <component-name>:<version> --no-update composer update bin/magento setup:...
mshakeel's user avatar
  • 528
12 votes

Package fabpot/php-cs-fixer is abandoned message in Magento 2

As the existing answers are not quite clear about it: this is not an error, only a warning. The abandoned package still exists, and Magento already replaced the dependency somewhere in version 2.1 so ...
Fabian Schmengler's user avatar
12 votes

Magento2 : Composer Problem Could not find a matching version of package <name>. Check the package spelling, your version

I had the same problem (also with this extension). For anyone who is facing an issue with installing any Magento Marketplace extension with Composer: please check your auth.json for the correct ...
MrPaulsky's user avatar
  • 231
12 votes
Accepted

Why Composer install is asking to allow-plugins?

Composer 2.2 comes with a new security feature, it does not trust plugins by default unless you specify it in the composer file, in July 2022 plugins will no longer be executed if they aren't ...
KAndy's user avatar
  • 20.9k
11 votes

What are the best practices for installing third party extensions in Magento 2?

Install module via composer is the best way to Magento 2. Becuase there are many advantages if we install module via composer. If you want to upgrade module you just need to change the version in ...
Prince Patel's user avatar
  • 22.9k
10 votes
Accepted

PHP requirement incompatible with your PHP version | Composer module installation error

Another solution is to run composer with the --ignore-platform-reqs argument. Then it won't check system requirements like PHP version and PHP extensions.
Fabian Schmengler's user avatar
10 votes

Problems with friendsofphp/php-cs-fixer and php7.3

1.composer require magento/composer-root-update-plugin=~1.0 --no-update open composer.json and change: from - "friendsofphp/php-cs-fixer": "~2.xx.x", to + "...
Vvvaida's user avatar
  • 568
10 votes
Accepted

Magento 2.4.3 and Composer error messages for allure phpunit and ramsey uuid - Can't continue with update

Magento 2.4.3 composer.json Taking a look at the 2.4.3 codebase, it looks like the composer.json has newer require-dev dependencies than what you have posted. Typically when doing upgrades, among ...
sdaugherty's user avatar
  • 1,251
9 votes

Magento 2.1.1 not compatibile with PHP 7.1.0

There are two possibilities: The devdocs are wrong and PHP 7.1 is not supported The requirement in composer.json is wrong. Since Magento 2.1 was released before PHP 7.1, it is most likely option (2) ...
Fabian Schmengler's user avatar
9 votes

How to Uninstall modules in Magento 2 using composer?

You can uninstall a module through composer if it was installed using composer. If yes then issue command: php bin/magento module:uninstall -r <Vendor>_<Module> -r flag removes module ...
Devtype's user avatar
  • 3,008
9 votes
Accepted

Get the composer version of installed modules

Maybe my code can be useful for you (tested in the observer): /** * @var \Magento\Framework\App\DeploymentConfig */ protected $deploymentConfig; /** * @var \Magento\Framework\Component\...
Siarhey Uchukhlebau's user avatar
9 votes
Accepted

Magento 2: usage of composer.json file?

Magento 2 uses Composer, a PHP dependency manager, to package components and product editions. Composer is a dependency management for PHP and in Magento 2, the composer plays the role in gathering ...
Prince Patel's user avatar
  • 22.9k
8 votes
Accepted

How to deploy public PHP files in Magento 2 extension?

First part is how to do this from an extension builder perspective. I'm leaving the second part as reference for project builders. Extension builder answer: You can't do this from within an ...
Vincent Hornikx's user avatar
8 votes

How to install modules in app/code with composer in Magento 2

I'm answering my own question, so it will be beneficial for someone else later, To be able to install in a custom path, your module must support composer/installers so add it to your module's require ...
nuwaus's user avatar
  • 2,334
8 votes

Magento 2: Composer update / install is no longer copying magento2-base structure

Found it! Turned out in a previous commit I accidentally removed the following from my composer.json-file: "extra": { "magento-force": "override" } Turns out that Magento uses this variable to ...
Giel Berkers's user avatar
  • 12.3k
8 votes

Cannot upgrade from 2.2.6 to 2.3 via composer

First be sure you are running PHP 7.1 or 7.2 Update your composer run those commandes: composer require magento/product-community-edition=2.3.0 --no-update Specify additional packages for ...
SoCix's user avatar
  • 512
8 votes

Upgrade to magento 2.4.3

For community edition composer require magento/product-community-edition=2.4.3 --no-update For enterprise edition composer require magento/product-enterprise-edition=2.4.3 --no-update composer ...
Sagar Dobariya's user avatar
7 votes
Accepted

Key issue when attempting to install Magento 2 EE with composer

If you use linux, you can change the default credential here /home/user/.composer/auth.json
Bilal Usean's user avatar
  • 10.1k
7 votes
Accepted

Magento 2 composer "module-wishlist" error

what you should do is: Remove from your composer.json all the sample data modules. Run composer update. Run "php -f bin/magento sampledata:deploy" this will add the latest sample data modules to your ...
Matias Hidalgo's user avatar
7 votes

Magento2 Delete config row while Extension Uninstall

I think Marius has forgotten his own module :) He has created a sample module with an uninstall script you can refer to same. $collection = $this->collectionFactory->create() ->...
Priyank's user avatar
  • 7,712
7 votes
Accepted

Autoload error: Vendor autoload is not found. Please run 'composer install' under application root directory in Magento 2

Actually your vendor is empty, because it always added in .gitignore. To resolve this follow these steps Download and install composer for windows Run CMD and go to your project directory Run ...
Shoaib Munir's user avatar
  • 9,542
7 votes

Magento2 : How To Solve Out Of Memory Limit Error While Using Composer Update Command

Try full path to composer whereis composer Once you know path php -d memory_limit=4G /opt/cpanel/composer/bin/composer update -vvv
Dominic Pixie's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible