How to Solve Spatie/laravel-sitemap installation issue

How to Solve Spatie/laravel-sitemap installation issue

Table of contents

No heading

No headings in the article.

Coming across issues when trying to install a package can sometimes be annoying and time-consuming. I came across this issue “spatie/crawler[6.0.0, ..., v6.x-dev] require guzzlehttp/psr7 ^1.7 -> found guzzlehttp/psr7[1.7.0, ..., 1.x-dev] but the package is fixed to 2.0.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.” when installing the package and it's due to dependency conflicts.

Screenshot (37).png

It took me a while to figure out something that helped resolve the issue, and I'm writing this to prevent anyone with the same problem from wasting their time.

In this article, I'll show you how to resolve the issue that might come up when installing the spatie/Laravel-sitemap package in your Laravel project.

What is spatie/Laravel-sitemap?

Spatie/Laravel-sitemap is a package that helps generate a sitemap without you having to add URLs to it manually. It works by crawling your entire site.

Resolving the issue

To fix the error, all you need to do is:

  1. Rename/delete your composer.lock file (it's advisable to rename it, so you don't break something in your code).
  2. Re-install the package, and everything should work perfectly.

Screenshot (38).png

Conclusion

I hope that you have been able to install the package successfully in your Laravel project by the end of this article.