1

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

asked Sep 7, 2018 at 11:51
1

2 Answers 2

3

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

answered Sep 10, 2018 at 10:21
0

You can try xampp shell to execute commands for Magento.

Check here : Magento 2 : How to install Porto theme using command prompt in Localhost?

answered Sep 7, 2018 at 11:57
5
  • I am using the xampp shell it gives the same output unfortunately Commented Sep 7, 2018 at 11:58
  • Did you set enviroment variable for your PHP installation ? Commented Sep 7, 2018 at 11:59
  • I didn't but I checked and it's set to c:/xampp/php Commented Sep 7, 2018 at 12:04
  • I've edited my answer please follow accepted answer It will definitely solve your problems for CLI. Commented Sep 7, 2018 at 12:06
  • No it doesn't I get the "There are no commands defined in the "setup" namespace." error Commented Sep 7, 2018 at 12:10

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.