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
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 ...
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-...
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 ...
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/...
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 ...
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 ...
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.
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:...
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 ...
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 ...
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 ...
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 ...
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.
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 + "...
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 ...
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) ...
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 ...
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\...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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
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 ...
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()
->...
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 ...
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
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
composer × 732magento2 × 504
upgrade × 95
installation × 70
module × 68
extensions × 58
magento-2.1 × 53
magento2.3 × 49
php × 40
magento2.4 × 26
git × 25
magento-upgrade × 23
error × 19
sample-data × 19
magento2.2 × 18
composer-update × 17
magento-1.9 × 16
marketplace × 15
patches × 14
third-party-module × 14
vendor × 14
php-7 × 12
theme × 11
cli × 11
setup × 10