Magento – Magento 2 setup:upgrade giving error

magento2setup-upgrade

I have installed Magento 2 on my ubuntu 14.04 virtual machine and when I created a new module and tried to do setup:upgrade after enabling it, it shows following error.

root@ubuntu:/var/www/html/Magento# php bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/html/Magento/var/generation/Composer
/var/www/html/Magento/var/generation/Magento
/var/www/html/Magento/var/generation/Symfony
The directory '/var/www/html/Magento/var/di/' doesn't exist - skipping cleanup
Updating modules:
Schema creation/updates:
Module 'Itdeation_Catalog':
Schema post-updates:
Module 'Itdeation_Catalog':
Data install/update:
Module 'Itdeation_Catalog':
Installing data... PHP Fatal error:  Cannot instantiate interface Magento\Eav\Model\Entity\Setup\PropertyMapperInterface in /var/www/html/Magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

Fatal error: Cannot instantiate interface Magento\Eav\Model\Entity\Setup\PropertyMapperInterface in /var/www/html/Magento/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

Please help!

Best Answer

First you can use this command for compiling di

php bin/magento setup:di:compile

After finish of compilation if not getting any error delete di folder from /var/www/html/Magento/var/ and then run setup upgrade.

Related Topic