skip to Main Content

I am unable to add new package in laravel project. I am using laravel 7.2
I was trying to run this command

composer require stripe/stripe-php

but i got below error.

    Problem 1
        - Root composer.json requires kreait/laravel-firebase ^3.0, 
found kreait/laravel-firebase[3.0.0] 
but the package is fixed to 2.2.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.

Use the option --with-all-dependencies (-W) to allow upgrades,
downgrades and removals for packages currently locked to specific versions.

I also tried composer update but still getting this error.

3

Answers


  1. From what I can see, your composer.json file has an outdated version of kreait/laravel-firebase package. stripe/stripe-php requires kreait/laravel-firebase version that is > 3.0 & your version is 3.0.0. Change the version of the kreait/laravel-firebase in your composer.json, then delete composer.lock file, and then composer install again. That way, all your packages will be updated to the new specified version. Without deleting composer.lock file, composer would only install cached versions of your packages, even if you change the versions.

    Login or Signup to reply.
  2. Just delete the composer.json and composer install everything will be fixed.

    Login or Signup to reply.
  3. You have to modify your composer.json file according to the error package version, In your case change from kreait/laravel-firebase ^3.0 to kreait/laravel-firebase ^3.0.0 Then Delete composer.lock file and run composer install command. Hopefully it will fix your problem.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search