Reputation: 2661
When I try to install Laravel Sanctum onto my application like so:
composer require laravel/sanctum
it returns the following error:
Your requirements could not be resolved to an installable set of packages.
Problem 1 - Root composer.json requires laravel/sanctum ^3.2 -> satisfiable by laravel/sanctum[v3.2.0, ..., 3.x-dev]. - laravel/sanctum[v3.2.0, ..., 3.x-dev] require illuminate/console ^9.21|^10.0 -> found illuminate/console[v9.21.0, ..., 9.x-dev, v10.0.0, ..., 10.x-dev] but these were not loaded, likely because it conflicts with another require.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/sanctum:*" to figure out if any version is installable, or "composer require laravel/sanctum:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
I'm currently on Laravel version 8.83.26. This is an old app and I upgraded with Laravel Shift a while back.
I can see from the Sanctum documentation that Sanctum comes out of the box with Laravel after Laravel 8. But for some reason my composer.json does not show Sanctum.
What should I do?
Upvotes: 0
Views: 1316
Reputation: 173
I think you should follow the instruction for your particular version in the given error. Mine worked for me..and yours would be: composer require laravel/sanctum:*
Run that on the terminal. To figure out if any version is installable.
Upvotes: 0