2017-08-04 101 views
0

我在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

回答

0

嘗試以下解決方案:

解決方案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

+0

已經遵循了所有這些解決方案。沒有運氣! – Pallavi