I'm trying to remove a few modules located inside the vendor folder. If i remove them manually it throws an error on the frontend.

Warning: require(/srv/public_html/vendor/composer/../amzn/amazon-pay-and-login-with-amazon-core-module/registration.php): failed to open stream: No such file or directory in /srv/public_html/vendor/composer/autoload_real.php on line 70

Fatal error: require(): Failed opening required '/srv/public_html/vendor/composer/../amzn/amazon-pay-and-login-with-amazon-core-module/registration.php' (include_path='/srv/public_html/vendor/magento/zendframework1/library:.:/usr/local/lib/php') in /srv/public_html/vendor/composer/autoload_real.php on line 70

Additionally, if I try to remove it using composer (which i thought all modules in vendor were composer installed) i get an error in terminal.

composer remove Amazon/Amazon_Core
amazon/amazon_core is not required in your composer.json and has not been removed
Package "amazon/amazon_core" listed for update is not installed. Ignoring.
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Package amasty/shopby-root is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files

The module/modules i'm trying to remove are the Amazon modules show above in the command line output.

Any help would be greatly appreciated. Thank you.

  • 1
    Here's a blog post explaining how you can do it the right way: integer-net.com/… – arjus Feb 1 '19 at 21:52
  • I didn't realize the amazon modules came preloaded. – Supplement Feb 1 '19 at 22:03
  • you're welcome. Happy it worked fine – arjus Feb 1 '19 at 22:25

You can not remove any module directly.

To remove or disable any module from Magento you need to follow some syntax.

Open file Below


Find your Module Name and you can disable module using "0".for Enable "1".

If you remove permanently then delete entry from database and delete module from directory.

To delete module from database find below table from phpmyadmin.

<Database Name>/setup_module

Remove your module entry from 'setup_module' table.

Apply command in terminal

php bin/magento s:up && php bin/magento c:c

Your module will remove permanently.

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.