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

时间:2020-03-03 14:54:14

标签: laravel laravel-ui

在安装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"
}

如何解决这个问题?

3 个答案:

答案 0 :(得分:6)

尝试一下: 它适用于我的laravel 6.2

composer require laravel/ui "^1.2"

答案 1 :(得分:4)

Laravel ui与Laravel 7一起发布了大约一个小时,而Laravel ui 2.0依赖于Laravel 7。

将项目升级到Laravel 7或安装Laravel ui 1.x。

答案 2 :(得分:2)

如果您使用的是laravel 6,请尝试使用此命令

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

您是否要升级到laravel 7?

如果是这种情况,您必须做错了事,我就按我所说的那样更新了,没有问题。

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

在laravel更新后,仅对框架运行composer update

如果您未正确执行此操作,则总是会收到错误消息。

另外,运行composer clearcache

composer selfupdate

composer dumpautoload

如果需要。

有时也有助于删除供应商并重新运行作曲家安装。