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
From what I can see, your
composer.json
file has an outdated version ofkreait/laravel-firebase
package.stripe/stripe-php
requireskreait/laravel-firebase
version that is >3.0
& your version is3.0.0
. Change the version of thekreait/laravel-firebase
in yourcomposer.json
, then deletecomposer.lock
file, and thencomposer install
again. That way, all your packages will be updated to the new specified version. Without deletingcomposer.lock
file, composer would only install cached versions of your packages, even if you change the versions.Just delete the
composer.json
andcomposer install
everything will be fixed.You have to modify your composer.json file according to the error package version, In your case change from
kreait/laravel-firebase ^3.0
tokreait/laravel-firebase ^3.0.0
Then Deletecomposer.lock
file and runcomposer install
command. Hopefully it will fix your problem.