Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel 8 Your requirements could not be resolved to an installable set of packages when running composer require laravel/passport

There are a lot of versions of this question floating around, but i haven't found any that deal with these specific packages.

I am trying to install laravel passport version 10 into my laravel 8 installation, When running composer require laravel/passport i get the following response:

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

  Problem 1
    - laravel/passport[v10.0.1, ..., 10.x-dev] require illuminate/auth ^8.2 -> found illuminate/auth[v8.2.0, ..., 8.x-dev] but it conflicts with another require.
    - laravel/passport v10.0.0 requires illuminate/auth ^8.0 -> found illuminate/auth[v8.0.0, ..., 8.x-dev] but it conflicts with another require.
    - Root composer.json requires laravel/passport ^10.0 -> satisfiable by laravel/passport[v10.0.0, v10.0.1, 10.x-dev].


Installation failed, reverting ./composer.json and ./composer.lock to their original content.

found illuminate/auth ^8.0 -> found illuminate/auth[v8.0.0, ..., 8.x-dev] <- I dont understand this part, does it have anything to do with having "minimum-stability": "dev" in my composer.json?

Anyways, here is my composer.json:

   {
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "fideloper/proxy": "^4.4.1",
        "fruitcake/laravel-cors": "^2.0.3",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^9.0",
        "laravel/passport": "^10.0",
        "laravel/tinker": "^2.5|dev-develop",
        "paragonie/random_compat": "2.*"
    },
    "require-dev": {
        "fakerphp/faker": "^1.9.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

EDIT 1: I tried running composer require --no-update laravel/passport and when i run composer update I get the following error(i though it may provide extra info):

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

  Problem 1
    - laravel/passport[v10.0.1, ..., 10.x-dev] require illuminate/support ^8.2 -> satisfiable by illuminate/support[v8.2.0, ..., 8.x-dev].
    - laravel/passport v10.0.0 requires illuminate/support ^8.0 -> satisfiable by illuminate/support[v8.0.0, ..., 8.x-dev].
    - Only one of these can be installed: illuminate/support[dev-master, v6.0.0, ..., 6.x-dev, v7.0.0, ..., 7.x-dev, v8.0.0, ..., 8.x-dev], laravel/framework[dev-master]. laravel/framework replaces illuminate/support and thus 
cannot coexist with it.
    - laravel/framework 9.x-dev is an alias of laravel/framework dev-master and thus requires it to be installed too.
    - Root composer.json requires laravel/framework ^9.0 -> satisfiable by laravel/framework[9.x-dev (alias of dev-master)].
    - Root composer.json requires laravel/passport ^10.0 -> satisfiable by laravel/passport[v10.0.0, v10.0.1, 10.x-dev].

EDIT 2: To further explain the answer below, you have to delete the vendor folder and composer.json file inside your project, the you run composer install to downgrade to laravel 8. After that you can run composer require laravel/passport and it will install properly

like image 619
javier1zq Avatar asked Nov 17 '20 16:11

javier1zq


1 Answers

Just simple do one thing

remove composer.lock file and then install your required package

It work for me...

like image 52
Rinkal Jasani Avatar answered Oct 02 '22 09:10

Rinkal Jasani