Magento2 – Module ‘Magento_CatalogInventory’ Already Defined Issue

magento-coremagento2modulesetup-upgrade

I'm getting this error after I ran the setup:upgrade command and this was after the upgrade to Magento 2.1.3

Module 'Magento_CatalogInventory' from '/var/www/vhosts/website/httpdocs/app/code/Magento/CatalogInventory' has been already defined in '/var/www/vhosts/website/httpdocs/vendor/magento/module-catalog-inventory'.

How do I fix this error?

Best Answer

You cloned your Magento from Github, so all your core is in folder app/code/Magento/, you need remove it and run the composer command to have your core in the folder vendor/.

Note that you shouldn't clone the repository, next time install using Composer.

These are the steps that I used to fix:

rm -rf var/view_preprocessed/ var/cache/ var/page_cache/ var/di/ var/tmp/ var/generation/ pub/static/frontend/ app/code/Magento/ vendor/magento composer.lock

chmod 777 -R *

composer update -vvvv

php -f bin/magento setup:static-content:deploy

find . -type d -exec chmod 775 {}

find . -type f -exec chmod 660 {}

chmod u+x bin/magento

bin/magento maintenance:disable

bin/magento cache:clean

The Composer command will install de vendor modules.

Related Topic