Getting a 'ReflectionException' error, "Class modules\Module does not exist' when I change the namespace of my module in Craft 3 First attempt at making a module. So far all I've done is try to change the namespace of the template that was included with my freshly installed craft 3.0.23.1 project. 

Was following the official docs (https://docs.craftcms.com/v3/extend/module-guide.html#set-up-the-basic-file-structure) and spend a few hours trying to figure this out on various searches here and elsewhere.

So in the file '/modules/Module.php' I changed

namespace modules;


to

namespace banana\modules;


, then in '/composer.json' changed:

  "autoload": {
    "psr-4": {
      "modules\\": "modules/"
    }
  },


to

  "autoload": {
    "psr-4": {
      "banana\\modules\\": "modules/"
    }
  },


Then in Terminal, ran the command 'composer dump-autoload -a' in the project folder. Reload the page and I get the error. Other than just doing the setup wizard, i haven't touched any other files in the project.
It's a bit difficult without seeing all of your code, but I'm going to guess that you also need to make changes in your config/app.php to make the namespace changes you're making.

So two things I'd recommend... first, you can generate your module's framework here: https://pluginfactory.io/

...and second I wrote up a tutorial on creating a module in the Enhancing a Craft CMS 3 Website with a Custom Module article.