I used Magento 2 stable version. when I run Magento setup:upgrade, following error occurred.

There are no commands defined in the "setup" namespace.

And when I run Magento indexer:reindex, also error display

There are no commands defined in the "indexer" namespace.

How to resolve this? Any other solution to reindex without CLI?


Reindex Magento 2 using the command.

Now You have to enter this command in your root installation folder.

sudo php -f ./bin/magento indexer:reindex

please clear folders di, page_cache, view_process , cache.

restart your command prompt and try to re-index.

I hope this will help you.

| improve this answer | |
  • Can i reindex by admin without use of cli ? – Khushbu Mehta Jan 2 '16 at 6:32
  • you have to set up cron job for this. – Denish Vachhani Jan 2 '16 at 6:35
  • 1
    i didnt understand Your path like var\www\html\magento2\bin how to reindex with my path and are you using \ instead of / or is it on purpose?` – Lynob Jun 21 '16 at 16:53
  • it is magento root folder path... – Denish Vachhani Jun 23 '16 at 4:50
  • 1
    sudo php /var/www/html/magento2/bin/magento indexer:reindex would work too, if you prefer to do everything in one step – Cragmonkey Jun 25 '17 at 0:00

In my case, I had wrong DB info in app/etc/env.php

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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