Magento 2: How to solve an error when reindex by CLI?
Pergunta
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?
Solução
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.
Outras dicas
In my case, I had wrong DB info in app/etc/env.php
Licenciado em: CC-BY-SA com atribuição
Não afiliado a magento.stackexchange