3

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

[InvalidArgumentException]
There are no commands defined in the "setup" namespace.

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

[InvalidArgumentException]
There are no commands defined in the "indexer" namespace.

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

3

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.

7
  • Can i reindex by admin without use of cli ? Jan 2 '16 at 6:32
  • you have to set up cron job for this. 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... 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
0

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

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.