phplaravelbreeze

error "Your requirements could not be resolved to an installable set of packages" appears when installing laravel breeze on laravel 9


when i want to install laravel breeze by running composer require laravel/breeze in my laravel 9 project.

error appears like this

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

  Problem 1
    - Root composer.json requires laravel/breeze 1.20.0 -> satisfiable by laravel/breeze[v1.20.0].
    - laravel/breeze v1.20.0 requires illuminate/console ^10.0 -> found illuminate/console[v10.0.0, ..., v10.4.1] but these were not loaded, likely because it conflicts with another require.


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

here is my composer json

{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"require": {
    "php": "^8.0.2",
    "guzzlehttp/guzzle": "^7.2",
    "laravel/framework": "^9.19",
    "laravel/sanctum": "^3.0",
    "laravel/tinker": "^2.7"
},
"require-dev": {
    "fakerphp/faker": "^1.9.1",
    "laravel/pint": "^1.0",
    "laravel/sail": "^1.0.1",
    "mockery/mockery": "^1.4.4",
    "nunomaduro/collision": "^6.1",
    "phpunit/phpunit": "^9.5.10",
    "spatie/laravel-ignition": "^1.0"
},
"autoload": {
    "psr-4": {
        "App\\": "app/",
        "Database\\Factories\\": "database/factories/",
        "Database\\Seeders\\": "database/seeders/"
    }
},
"autoload-dev": {
    "psr-4": {
        "Tests\\": "tests/"
    }
},
"scripts": {
    "post-autoload-dump": [
        "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
        "@php artisan package:discover --ansi"
    ],
    "post-update-cmd": [
        "@php artisan vendor:publish --tag=laravel-assets --ansi --force"
    ],
    "post-root-package-install": [
        "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
    ],
    "post-create-project-cmd": [
        "@php artisan key:generate --ansi"
    ]
},
"extra": {
    "laravel": {
        "dont-discover": []
    }
},
"config": {
    "optimize-autoloader": true,
    "preferred-install": "dist",
    "sort-packages": true,
    "allow-plugins": {
        "pestphp/pest-plugin": true
    }
},
"minimum-stability": "stable",
"prefer-stable": true

}

heres is my package.json

{ "private": true, "scripts": { "dev": "vite", "build": "vite build" }, "devDependencies": { "axios": "^1.1.2", "laravel-vite-plugin": "^0.7.2", "lodash": "^4.17.19", "postcss": "^8.1.14", "vite": "^4.0.0" } }


Solution

  • I got the solution, it's because laravel breeze version can't be installed in laravel 9. after i open my laravel 9 project and see the competible version of breeze.

    finally i added/replaced in composer.json to "laravel/breeze": "^1.19",

    then install composer require laravel/breeze:^1.19

    this will solve the problem