Usually I get the n98-magerun file by executing this command when I need it: wget https://files.magerun.net/n98-magerun.phar && chmod +x ./n98-magerun.phar on my project . I used this in the last year, now today did the same thing and from all of the sudden when I executed it, I'm getting this error:

PHP Fatal error:  Uncaught Error: Call to undefined method N98\Magento\Application\Console\Event::setName() in phar:///opt/lampp/htdocs/rebuildnew/httpdocs/n98-magerun.phar/vendor/symfony/event-dispatcher/EventDispatcher.php:43

Stack trace:
#0 phar:///opt/lampp/htdocs/rebuildnew/httpdocs/n98-magerun.phar/src/N98/Magento/Application.php(580): Symfony\Component\EventDispatcher\EventDispatcher->dispatch('n98-magerun.app...', Object(N98\Magento\Application\Console\Event))
#1 phar:///opt/lampp/htdocs/rebuildnew/httpdocs/n98-magerun.phar/vendor/symfony/console/Application.php(122): N98\Magento\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#2 phar:///opt/lampp/htdocs/rebuildnew/httpdocs/n98-magerun.phar/src/N98/Magento/Application.php(625): Symfony\Component\Console\Application->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#3 /opt/lampp/htdocs/rebuildnew/httpdocs/n98-magerun.phar(22): N98\M in phar:///opt/lampp/htdocs/rebuildnew/httpdocs/n98-magerun.phar/vendor/symfony/event-dispatcher/EventDispatcher.php on line 43

I believed that somehow composer is to blame so I did a composer update but I'm still getting the error. Any idea why ?

Thank you


We have the same issue. What happens is that magerun includes Mage.php from your Magento project and this on its turn includes the autoloader from your project.

Your project has a dependency on a different version of symfony/event-dispatcher.

In our case Magerun symfony/event-dispatcher (v2.8.16) while our project depends on symfony/event-dispatcher (v3.3.8) We downgraded our dependencies in the Magento project to match the versions of magerun.

Hope this helps your case.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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