Error installing package (Installation failed, reverting ./composer.json to its original content.)
Stefan Izdrail
Founder & Senior Architect · 2026-06-29
Title: Troubleshooting Common Composer Errors During Package Installation
Introduction: In the world of web development, using third-party packages is essential to simplify and accelerate your projects. However, when installing a package with composer, you might encounter errors that hinder successful installation. In this comprehensive guide, we'll delve into the issue of "Installation failed, reverting ./composer.json to its original content" while attempting to install an external package like rpsimao/invoicexpress-api.
Problem Analysis: To understand why you encountered the mentioned error, let's break down the various components involved in this process. A Laravel application is typically built on Laravel framework version 5.5, while the invoicexpress-api package requires a minimum Laravel version of 5.4. You can see that there's a conflict between your current Laravel version and the required one for the invoicexpress-api package to work correctly.
Solution 1: Upgrade Laravel Framework
The first approach to resolve this issue is to upgrade your Laravel framework to at least the minimum supported version, which in this case is 5.4. This can be done by following these steps:
1. Create a backup of your current Laravel application before proceeding.
2. Run "composer update" or "composer install" to ensure all dependencies are up-to-date.
3. Uninstall the Laravel framework using "composer remove laravel/framework".
4. Update your composer.json file with the required version of the Laravel framework.
5. Run "composer require laravel/framework:~5.4" to install the latest stable or patched version (if available) that supports invoicexpress-api.
6. Install the invoicexpress-api package using "composer require rpsimao/invoicexpress-api".
7. Verify if the installation is successful by running "php artisan" and check for any composer errors.
Solution 2: Downgrade Laravel Framework
If upgrading to version 5.4 isn't an option, consider downgrading your current framework to a compatible version that allows you to use the invoicexpress-api package.
1. Create a backup of your current Laravel application before proceeding.
2. Uninstall the Laravel framework using "composer remove laravel/framework".
3. Update your composer.json file with an older supported version.
4. Run "composer require laravel/framework" to install the old version that supports your project.
5. Install the invoicexpress-api package using "composer require rpsimao/invoicexpress-api".
6. Verify if the installation is successful by running "php artisan" and check for any composer errors.
Conclusion: In this blog post, we explored the causes behind installing a Laravel package that failed due to version conflicts or incompatibilities. We provided two possible solutions that can help you resolve these issues depending on your application requirements. Remember always to read package documentation carefully before and after installation to ensure smooth integration with your current framework and any other packages you might be using. For more detailed assistance, refer to the Laravel Company's extensive support resources at https://laravelcompany.com or reach out directly for customized solutions tailored to your needs.