Skip to content

Instantly share code, notes, and snippets.

@bka
Created December 19, 2015 11:06
Show Gist options
  • Save bka/d44fb33d1eaf780e1b76 to your computer and use it in GitHub Desktop.
Save bka/d44fb33d1eaf780e1b76 to your computer and use it in GitHub Desktop.
Magento2: Copy Paste Error in Module name
$ bin/magento
We're sorry, an error occurred. Try clearing the cache and code generation directories. By default, they are: var/cache, var/di, var/generation, and var/page_cache.
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An abstract factory could not create an instance of magentosetupconsolecommandmoduleuninstallcommand(alias: Magento\Setup\Console\Command\ModuleUninstallC
ommand).
[Zend\ServiceManager\Exception\ServiceNotCreatedException]
An exception was raised while creating "Magento\Setup\Console\Command\ModuleUninstallCommand"; no instance returned
[Magento\Framework\Exception\FileSystemException]
The file "/composer.json" doesn't exist
===================================================
// Foo_Bar' Quote in module name was the cause ....
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../../../../../lib/internal/Magento/Framework/Module/etc/module.xsd">
<module name="Foo_Bar'" setup_version="0.0.1" data_version="0.0.1"/>
</config>
@mbahar
Copy link

mbahar commented Feb 17, 2016

Also happens when the module name in module.xml does not match with path based namespace.
etc: code/Vendor/myModuleName

@thealexbaron
Copy link

Thank you for the tip, @mbahar

@Gujarats
Copy link

@mbahar Thank you this one works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment