在laravel中安装ui时如何解决问题?

How to solve problems while installing ui in laravel?

安装 laravel/ui 时出现以下错误。

Using version ^2.0 for laravel/ui

  Problem 1
    - Conclusion: remove laravel/framework v6.18.0
    - Conclusion: don't install laravel/framework v6.18.0
    - laravel/ui 2.x-dev requires illuminate/support ^7.0 -> satisfiable by laravel/framework[7.x-dev], illuminate/support[7.x-dev, v7.0.0, v7.0.1].
    - laravel/ui v2.0.0 requires illuminate/support ^7.0 -> satisfiable by laravel/framework[7.x-dev], illuminate/support[7.x-dev, v7.0.0, v7.0.1].
    - Can only install one of: laravel/framework[7.x-dev, v6.18.0].
    - don't install illuminate/support 7.x-dev|don't install laravel/framework v6.18.0
    - don't install illuminate/support v7.0.0|don't install laravel/framework v6.18.0
    - don't install illuminate/support v7.0.1|don't install laravel/framework v6.18.0
    - Installation request for laravel/framework (locked at v6.18.0, required as ^6.2) -> satisfiable by laravel/framework[v6.18.0].
    - Installation request for laravel/ui ^2.0 -> satisfiable by laravel/ui[2.x-dev, v2.0.0].

我的laravel版本是6.18这里是composer.json

的一些重要内容
"require": {
    "php": "^7.2",
    "fideloper/proxy": "^4.0",
    "laravel/framework": "^6.2",
    "laravel/tinker": "^2.0"
},
"require-dev": {
    "facade/ignition": "^1.4",
    "fzaninotto/faker": "^1.9.1",
    "mockery/mockery": "^1.0",
    "nunomaduro/collision": "^3.0",
    "phpunit/phpunit": "^8.0"
}

如何解决这个问题?

Laravel ui 大约一个小时前与 Laravel 7 一起发布,Laravel ui 2.0 取决于 Laravel 7.

要么将您的项目升级到 Laravel 7,要么安装 Laravel ui 1.x。

如果您正在使用 laravel 6,请尝试此命令

composer require laravel/ui "^1.0" --dev -vvv

您是否正在尝试升级到 laravel 7?

如果是这种情况,你一定是做错了什么,我刚刚按照我说的更新了,没问题。

您必须先更新 laravel 而不是框架。

laravel 更新后框架仅 运行 composer update

如果您没有正确执行此操作,您将始终遇到错误。

另外,运行 composer clearcache

composer selfupdate

composer dumpautoload

如果需要。

有时删除 vendor 并重新运行 composer install 也有帮助。

试试这个: 它适用于我的 laravel 6.2

composer require laravel/ui "^1.2"

运行 当前可用版本

 composer require laravel/ui