12

I try to install:

composer require laravel/ui

But i Keep receive this error:

laravel/ui[v3.2.0, ..., 3.x-dev] require illuminate/console ^8.0 -> found illuminate/console[v8.0.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require. - Root composer.json requires laravel/ui ^3.2 -> satisfiable by laravel/ui[v3.2.0, 3.x-dev]. and here is my composer.json:

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.2.5|^8.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^6.3.1|^7.0.1",
        "laravel/framework": "^7.29",
        "laravel/tinker": "^2.5"
    },
    "require-dev": {
        "facade/ignition": "^2.0",
        "fakerphp/faker": "^1.9.1",
        "mockery/mockery": "^1.3.1",
        "nunomaduro/collision": "^4.3",
        "phpunit/phpunit": "^8.5.8|^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/"
        },
        "classmap": [
            "database/seeds",
            "database/factories"
        ]
    },
    "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"
        ]
    }
}

I am a beginner in laravel. Hope anyone provide the solution. Thanks in advance.

kiana.ka
  • 509
  • 2
  • 5
  • 13
  • What have you tried to resolve the problem? You are using an outdated version of Laravel, and the package you want to require is not compatible with that "old" version – Nico Haase Mar 03 '21 at 15:16
  • Sounds like it's conflicting with other packages you have installed. I had a similar issue and realized that I had to update my Telescope package to get the composer command to work. Try composing an older version and see if you get the same error: "composer require laravel/ui:^2.0" – Abdullah Aman Apr 25 '21 at 19:15
  • I bet many of us will continue using an 'outdated' version of Laravel. Not everyone wants to divert valuable business development time to reading about new laravel stuff that they don't really need. – McAuley May 27 '21 at 14:45
  • composer require laravel/ui:^3.* this is the perfect solution – Pri Nce May 28 '21 at 18:56

3 Answers3

32

I used this:

composer require laravel/ui:^2.4

instead of

composer require laravel/ui

and it worked! according to this laravel document [link]: https://laravel.com/docs/7.x/frontend

Nelson Sammy
  • 404
  • 2
  • 7
  • 16
kiana.ka
  • 509
  • 2
  • 5
  • 13
  • 1
    If you have Laravel 8, try to update your packages with: composer update then run again: composer require laravel/ui and it should work – Yassin Sep 07 '21 at 17:10
5

According to Laravel framework documentation use this command

Laravel 8.* in requires laravel/ui version 3.4

composer require laravel/ui:^3.4

Laravel 7. in requires laravel/ui version 2.4

composer require laravel/ui:^2.4

Laravel 6.* in requires specific laravel/ui version 1.0

composer require laravel/ui:^1.0 --dev

Laravel 7 UI documentation

Laravel 6 UI documentation

Vishal Vaghasiya
  • 1,857
  • 2
  • 14
  • 21
1

You must update your packages with :

composer update

then you can run :

composer require laravel/ui
Amr Khaled
  • 11
  • 2