I am trying to update to latest version but when I run upgrade command from the console than its showing below upgrade error.

enter image description here

2 Answers 2


Please follow these steps, and then try

rm -rf app/code/Magento/ var/* vendor/*
chmod 777 -R *
composer update && composer install
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

Refer this for more info : Module 'Magento_CatalogInventory' has already been defined

  • Hi, I have already tried that but now working.
    – Meetanshi
    Commented Nov 15, 2017 at 13:03

I upgraded from Magento 2.1.9 to Magento 2.2.1 using these commands

composer require magento/product-community-edition 2.2.1 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex

After upgrade, check your Magento version with the following command:

php bin/magento --version


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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