The error there are no commands defined in the “cache” namespace.
When you have used Magento, you will encounter this error and take a lot of time to find a way to fix it.
Today I have a tutorial to fix the There are no commands defined in the “cache” namespace error.
Everything is working now but there are no commands defined in the “cache” namespace is still there.
You tried chmod 777 -R var/generation did not fix the problem. if I clear the cache from the admin area, I see no error. You need to fix it otherwise I’ll never be able to install any module or this fix.
That error comes up when a module does not correctly declare its commands. It just stops Magento from correctly reading the whole commands list.
Unless you have broken third-party modules, you probably have something left in your cache or generation folder preventing you to correctly run Magento commands.
From your Magento root:
NOTE: I usually use
php -d memory_limit=-1 on my local, so it’s up to you to use that or not.
1. rm -rf generated/code 2. rm -rf var/cache/* 3. rm -rf var/view_preprocessed 4. php -d memory_limit=-1 /usr/bin/composer install 5. php -d memory_limit=-1 bin/magento
Then try again:
php bin/magento cache:flush
If it does not work just try to run:
And see what is the last shown command.