Module could not be loaded

I have created one test module and checked everything working fine.

After i have deleted that module related files. But now i follow the same procedure to activate the module but it’s not activated below error message displayed with extend controller files

“Invalid modules were detected.
Do you want to delete all registered module information and saved configurations?”

Can anyone please give me the solution

have you add it in the composer.json and start “composer update -n” in terminal?

yes i have added in the composer.json file.

Sometimes this happen because of a typo - wrong spelled class name, wrong namespace, wrong filename etc…

Maybe u could try to change module id in metadata.php - if u sure that u wont have any typos.

Otherwise its not easy to help u without code - could u post ur code on github or something similar?

I think this message appears because of the old module settings (from the test module). You deactivated it and deleted the module files. So some settings are still available.

the shop remember an old path f.e:
mymoduleid => modules/myvendorname/oldmoduleFolder

now you want to activate the module in a other folder:
mymoduleid => modules/myvendorname/mymoduleid

The shop “remembers” that the module id “mymoduleid” has to be located in “modules/myvendorname/oldmoduleFolder”

To fix this, you have to delete the path variables or use this script:
(replace “d3modcfg_lib” occurrences with “mymoduleid”)