2

I tried installing laravel/passport by running composer require laravel/passport and it gives me error saying :

Your requirements could not be resolved to an installable set of packages.



Problem 1
    - lcobucci/jwt 4.2.x-dev requires ext-sodium * -> the requested PHP extension sodium is missing from your system.
    - lcobucci/jwt 4.1.x-dev requires ext-sodium * -> the requested PHP extension sodium is missing from your system.
    - lcobucci/jwt 4.1.0 requires ext-sodium * -> the requested PHP extension sodium is missing from your system.
    - Conclusion: don't install laravel/passport v10.1.0
    - Conclusion: remove lcobucci/jwt 3.3.3
    - Installation request for laravel/passport ^10.1 -> satisfiable by laravel/passport[10.x-dev, v10.1.0].
    - Conclusion: don't install lcobucci/jwt 3.3.3
    - laravel/passport 10.x-dev requires lcobucci/jwt ^3.4|^4.0 -> satisfiable by lcobucci/jwt[3.4.0, 3.4.1, 3.4.2, 3.4.3, 3.4.x-dev, 4.0.0, 4.0.0-alpha1, 4.0.0-alpha2, 4.0.0-alpha3, 4.0.0-beta1, 4.0.1, 4.0.x-dev, 4.1.0, 4.1.x-dev, 4.2.x-dev].
    - Can only install one of: lcobucci/jwt[3.4.0, 3.3.3].
    - Can only install one of: lcobucci/jwt[3.4.1, 3.3.3].
    - Can only install one of: lcobucci/jwt[3.4.2, 3.3.3].
    - Can only install one of: lcobucci/jwt[3.4.3, 3.3.3].
    - Can only install one of: lcobucci/jwt[3.4.x-dev, 3.3.3].
    - Can only install one of: lcobucci/jwt[4.0.0, 3.3.3].
    - Can only install one of: lcobucci/jwt[4.0.0-alpha1, 3.3.3].
    - Can only install one of: lcobucci/jwt[4.0.0-alpha2, 3.3.3].
    - Can only install one of: lcobucci/jwt[4.0.0-alpha3, 3.3.3].
    - Can only install one of: lcobucci/jwt[4.0.0-beta1, 3.3.3].
    - Can only install one of: lcobucci/jwt[4.0.1, 3.3.3].
    - Can only install one of: lcobucci/jwt[4.0.x-dev, 3.3.3].
    - Installation request for lcobucci/jwt (locked at 3.3.3) -> satisfiable by lcobucci/jwt[3.3.3].

  To enable extensions, verify that they are enabled in your .ini files:
    - C:\xampp\php\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

Installation failed, reverting ./composer.json to its original content.

I saw some solution in SO saying adding some version to the laravel/passport like so : composer require laravel/passport:7.5.1, but I'm not confident if this works with laravel 8

modi
  • 297
  • 2
  • 3
  • 15

5 Answers5

4

you can uncomment the "sodium" extension in the php.ini file

ahmad
  • 41
  • 3
  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 14 '22 at 09:58
3

I had the same problem while deploying a Laravel app into EC2 AMI2 as OS. I was I just installed ext-sodium using:

sudo yum install php-sodium
Dharman
  • 30,962
  • 25
  • 85
  • 135
3

Just Delete the composer.lock file and run composer install command again. Don't forget to thanks me :)

Most of Cases, Issue generate by composer lock file so delete it before setup the project

Abhishek Thakur
  • 53
  • 1
  • 2
  • 9
0

Problem 1

  • lcobucci/jwt 4.2.x-dev requires ext-sodium * -> the requested PHP extension sodium is missing from your system.

it looks like extension:sodium is commented in your php.ini file goto your php.ini file and uncomment it , then reload your apache if you use xampp then try to run composer again

MostafaHashem
  • 127
  • 2
  • 3
0

Use this command to fix it composer require laravel/passport --with-all-dependencies this will allow upgrades, downgrades and removals for packages currently locked to specific versions.

chinky
  • 11
  • 2
  • If you have a new question, please ask it by clicking the [Ask Question](https://stackoverflow.com/questions/ask) button. Include a link to this question if it helps provide context. - [From Review](/review/late-answers/34655673) – Yogendra Jul 12 '23 at 08:48