magento2奇怪的问题在“setup”命名空间中没有定义命令
问题描述:
我在M2的整个安装中遇到了以下问题。magento2奇怪的问题在“setup”命名空间中没有定义命令
[InvalidArgumentException]
There are no commands defined in the "setup" namespace.
奇怪的是我安装了新的XAMPP和建立新的M2的实例,那么也同样问题仍然存在。它突然开始了,我已经尝试了所有可用的解决方案,例如设置文件夹权限,并尝试使用-vvv选项和list命令来查找确切的问题。 直到现在没有成功。我整天只是在调试这个过程中浪费时间,现在我已经没有想法了。 如果有人有想法?
我使用PHP 5.6和Magento的EE 2.1.7
答
尝试以下解决方案:
解决方案1:请注明setup_version在module.xml文件。您的module.xml文件如下所示:
<?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="Vendor_Module" setup_version="1.0.0"/>
</config>
解决方案2:您需要递归完全授予var和pub文件夹。
sudo chmod -R 777 var pub
如果上述方案不能工作,那么尝试以下链接 https://magento.stackexchange.com/questions/103774/magento-2-there-are-no-commands-defined-in-the-setup-namespace-on-windows
已经遵循了所有这些解决方案。没有运气! – Pallavi