I have a VM running Magento 2 with the sample data that was installed not using composer - I grabbed the latest version from the Magento site). The site itself runs fine, but when I try to run anything for the command line, I get this error:

PHP Fatal error:  Uncaught Error: Class 'Magento\Setup\Mvc\Bootstrap\InitParamListener' not found in /var/www/html/public/setup/config/application.config.php:24
Stack trace:
#0 /var/www/html/public/vendor/magento/framework/Console/Cli.php(57): require()
#1 /var/www/html/public/bin/magento(22): Magento\Framework\Console\Cli->__construct('Magento CLI')
#2 {main}
  thrown in /var/www/html/public/setup/config/application.config.php on line 24

I built the VM on another machine using build scripts, and then used those to build it on this machine, and it worked for a bit, but I suspect I left something out of source control that would be causing this.

3 Answers 3


Check that the composer.json file in the Magento root directory is not corrupted / overwritten. You can compare it with the official composer.json file from https://github.com/magento/magento2


I got a very similar issue with the following error;

Zend\ServiceManager\ServiceManager::get was unable to fetch or create an instance for Magento\Setup\Mvc\Bootstrap\InitParamListener

I was able to solve this by deleting the contents of vendor and then re-running composer install


I can see that something is running inside the vendor folder:

#0 /var/www/html/public/vendor/magento/framework/Console/Cli.php(57)

Please, try:

composer self-update && composer update
  • 1
    I did that earlier and it wiped out my magento install. My composer.json only has this: { "repositories": { "magento": { "type": "composer", "url": "repo.magento.com" } } }. I assume that has to do with the fact that I didn't use composer to install Magento?
    – Laura
    Feb 11, 2017 at 4:26
  • Yes @Laura , probably. Sorry, I did not pay attention to the part of your question that had not used composer.. Got a solution for this? Mar 3, 2017 at 17:59
  • This wiped out the entire Magento install
    – snez
    Aug 13, 2019 at 7:16

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.