O. Hebaby
O. Hebaby

Reputation: 53

Problem with installing a Laravel package using composer

I want to using a package in my project.

Composer.json:

"require": {
    "php": "^7.2.5|^8.0",
    "fideloper/proxy": "^4.4",
    "fruitcake/laravel-cors": "^2.0",
    "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
    "hekmatinasser/verta": "^1.11",
    "laravel/framework": "^7.29",
    "laravel/passport": "^9.3",
    "laravel/tinker": "^2.5",
    "lcobucci/jwt": "3.3.3",
    "pishran/zarinpal": "^2.2"
},

My target package to install :

composer require ipecompany/smsirlaravel

Problem : When I try this on composer, I see follwing error

Problem 1
- ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7] require guzzlehttp/guzzle ~6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but the package is fixed to 7.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.
- Root composer.json requires ipecompany/smsirlaravel ^1.0 -> satisfiable by ipecompany/smsirlaravel[v1.0.0, ..., v1.0.7].

I tried :

composer require ipecompany/smsirlaravel -W

But the main problem is Laravel Passport maybe because of following error :

  Problem 1
    - laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
    - laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.

I tried to install laminas/laminas-diactoros ^2.2 but I got another error

problem 1
    - Root composer.json requires laminas/laminas-diactoros 2.2, found laminas/laminas-diactoros[2.2.0] but it conflicts with another require.
  Problem 2
    - laravel/passport is locked to version v9.3.2 and an update of this package was not requested.
    - laravel/passport v9.3.2 requires laminas/laminas-diactoros ^2.2 -> found laminas/laminas-diactoros[2.2.0, ..., 2.6.x-dev] but it conflicts with another require.

Any body can help me to install this package? TNX

Upvotes: 3

Views: 3456

Answers (1)

Nico Haase
Nico Haase

Reputation: 12131

As written in the first error message: ipecompany/smsirlaravel requires v6 of Guzzle, but currently v7 is installed. You should use a different version constraint for Guzzle first: change "guzzlehttp/guzzle": "^6.3.1|^7.0.1" to "guzzlehttp/guzzle": "^6.3.1". Afterwards, run composer update guzzlehttp/guzzle such that Guzzle v6 is installed.

Afterwards, running composer require ipecompany/smsirlaravel should work

Upvotes: 1

Related Questions