Right after installing magento, (2.3.2), I run
bin/magento deploy:mode:set developer
to enable developer mode. I remember when I had done before without setting this flag, the instance worked fine.
This command succeeded, but right after that, I am not even able to run any of the Magento commands.
Even the command to know the current status fails
>bin/magento deploy:mode:show 
Class Magento\Framework\App\ResourceConnection\Proxy does not exist
(since magento command itself is broken, di:compile or even turning off the developer mode will fail).
I could salvage the situation by copying the generated files from my another instance. But I am not sure why this happens and how to force it to regenerate the generated files.
1 Answer 1
Run below commands from the Magento root terminal
cd <your Magento install directory>/var
rm -rf cache/* di/* generation/* page_cache/*
chmod -R 777 var/ pub/ generated/
Also, run the below commands from terminal:
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento cache:flush
chmod -R 777 var/ pub/ generated/
Hope it helps!!!
- 
 I deleted them, but still bin/magento deploy:mode:show is not working.melchi– melchi2019年09月02日 12:30:14 +00:00Commented Sep 2, 2019 at 12:30
- 
 Give permission to var, pub and generated folder with this command "chmod -R 777 var/ pub/ generated/"Sumit– Sumit2019年09月02日 12:31:29 +00:00Commented Sep 2, 2019 at 12:31
- 
 thanks sumit, yes, I did that too. Setting to developer mode clearly deletes the generated folder, which seems to be needed for the magento tool itself to work.melchi– melchi2019年09月02日 12:32:13 +00:00Commented Sep 2, 2019 at 12:32
- 
 Yes, you need to run the deployment commands again to make it work. I've updated my answer for the same.Sumit– Sumit2019年09月02日 12:36:31 +00:00Commented Sep 2, 2019 at 12:36
- 
 This is what I meant @melchi - I've deleted my answer as Sumit's explains it better :PBen Crook– Ben Crook2019年09月02日 12:42:20 +00:00Commented Sep 2, 2019 at 12:42