My Magento 2 was running normally, then I tried to change for production mode and I'm getting the following error:
Command returned non-zero exit code:
`php -f /var/www/magento2.strip-curtains.com/public_html/bin/magento setup:di:compile-multi-tenant 2>&1`
When I run the command #php -f /var/www/magento2.strip-curtains.com/public_html/bin/magento setup:di:compile-multi-tenant 2>&1
[ReflectionException] Class \Smartwave\Megamenu\Model\Attribute\SubcatColumns does not exist
setup:di:compile-multi-tenant [--serializer="..."] [--extra-classes-file="..."] [--generation="..."] [--di="..."] [--exclude-pattern="..."] [--magento-init-params="..."]
I can only run the site if I set back to developer mode.
Best Answer
In this case I think you are running into one of three issues.
You need to run
php bin/magento setup:upgrade
to update the list of modules in case you have removed or changed one. If you did remove theSmartwave
module without resetting yourapp/etc/config.php
it's possible to get this error.You have removed the
Smartwave
module but there is still code the uses some of it's classes or extends from it that haven't been updated.You need to clear that var folder's that could have old content in them. They are typically
var/di, var/view_preprocessed, var/cache, var/page_cache, var/generation
. Clearing these might solve the issue.From here, I would grep for the use of the
Smartwave
module in theapp
andvendor
folders and see what comes up to figure out where it's being used.grep -r "Smartwave" app/*