Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

It looks like you installed Magento by cloning the github repository and then tried to upgrade using composer. The problem is that composer places the core modules in the Vendor directory while cloning the repository results in them being in App/Code directory, so now you have duplicates. You should remove the App/Code/Magento directory to solve the error. Note that you shouldn't clone the repository, next time install with composer.

Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top