I installed a local Magento environment on XAMPP using composer. The database is also running on XAMPP (MySql). After the (web) setup i found out that the static files where not generated yet so I tried to run following command:
php bin/magento setup:static-content:deploy -f
I got the "There are no commands defined in the "setup" namespace." error. After that I tried running cache:clear but I got the same error.
When I run
php bin/magento
I got 3 error message along with some normal info. The error message are the following:
[Zend\ServiceManager\Exception\ServiceNotCreatedException] An abstract factory could not create an instance of magentosetupconsolecommandconfigsetcommand(alias: Magento\Setup\Console\Command\ConfigSetCommand).
[Zend\ServiceManager\Exception\ServiceNotCreatedException] An exception was raised while creating "Magento\Setup\Console\Command\ConfigSetCommand"; no instance returned
[Magento\Framework\Exception\FileSystemException] Cannot read contents from file "C:\xampp\htdocs\magitas\app\code\duo\main\etc\module.xml" Warning!file_get_contents(C:\xampp\htdocs\magitas\app\code\duo\main\etc\module.xml): failed to open stream: No such file or directory
I have the correct user rights (otherwise my setup would not have run).
Thanks
-
please try: magento.stackexchange.com/questions/186169/…Pawan– Pawan2018年09月07日 16:06:15 +00:00Commented Sep 7, 2018 at 16:06
2 Answers 2
Found the solution, and I'm a little embarrassed to be honest. It was because the module.xml file was not created in one of my custom modules
You can try xampp shell to execute commands for Magento.
Check here : Magento 2 : How to install Porto theme using command prompt in Localhost?
-
I am using the xampp shell it gives the same output unfortunatelyArno Vande Cappelle– Arno Vande Cappelle2018年09月07日 11:58:39 +00:00Commented Sep 7, 2018 at 11:58
-
Did you set enviroment variable for your PHP installation ?TBS Mage– TBS Mage2018年09月07日 11:59:15 +00:00Commented Sep 7, 2018 at 11:59
-
I didn't but I checked and it's set to c:/xampp/phpArno Vande Cappelle– Arno Vande Cappelle2018年09月07日 12:04:46 +00:00Commented Sep 7, 2018 at 12:04
-
I've edited my answer please follow accepted answer It will definitely solve your problems for CLI.TBS Mage– TBS Mage2018年09月07日 12:06:44 +00:00Commented Sep 7, 2018 at 12:06
-
No it doesn't I get the "There are no commands defined in the "setup" namespace." errorArno Vande Cappelle– Arno Vande Cappelle2018年09月07日 12:10:06 +00:00Commented Sep 7, 2018 at 12:10