1

I have installed Magento version 2.1 without sample data. I have an issue regarding the command php bin/magento setup:upgrade. It creates an error of

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

I have attempt all solutions but nothing works for me. Please sort out my issue.

colidyre
  • 4,170
  • 12
  • 37
  • 53
  • Does this answer your question? [There are no commands defined in the "setup" namespace : Magento 2](https://stackoverflow.com/questions/33935850/there-are-no-commands-defined-in-the-setup-namespace-magento-2) – Victor S. Dec 10 '21 at 15:32

1 Answers1

0

You can try doing the following:

  1. First, check your deployment configuration if it is in developer mode. You can do that by using php bin/magento deploy:mode:show. If it is not in developer mode, switch to it by using php bin/magento deploy:mode:set developer.

  2. Next, delete everything in the generated folder, except the .htaccess file.

  3. Then refresh your Magento website.

That should regenerate all the classes needed to run setup:upgrade in the generated folder.

Hope this helps!

Jas
  • 188
  • 1
  • 3
  • 16