首页 > 解决方案 > “安装失败,正在将 ./composer.json 还原为原始内容”怎么办?尝试通过作曲家在 laravel 上安装 Ignition 时?

问题描述

我正在尝试通过作曲家在 laravel 中安装点火

composer require --dev facade/ignition

但它一直给我这个错误信息:

Using version ^1.6 for facade/ignition
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Installation request for facade/ignition ^1.6 -> satisfiable by facade/ignition[1.6.0].
    - Conclusion: don't install filp/whoops 2.5.0
    - Can only install one of: filp/whoops[2.4.0, 2.1.13].
    - Can only install one of: filp/whoops[2.4.0, 2.1.13].
    - Can only install one of: filp/whoops[2.4.0, 2.1.13].
    - facade/ignition 1.6.0 requires filp/whoops ^2.4 -> satisfiable by filp/whoops[2.4.0, 2.4.1, 2.5.0].
    - Conclusion: don't install filp/whoops 2.4.1
    - Installation request for filp/whoops (locked at 2.1.13, required as ~2.0) -> satisfiable by filp/whoops[2.1.13].


Installation failed, reverting ./composer.json to its original content.

标签: phplaravelcomposer-php

解决方案


你不能在同一个 Laravel 应用程序上同时安装 filp/whoops 2.5.0 和 facade/ignition 1.0-dev,因为点火需要 ^2.4 版本的 whoops 所以删除你手动安装的 whoops 版本并让点火安装正确的版本本身在包的composer.json.

{
    "name": "facade/ignition",
    "homepage": "https://github.com/facade/ignition",
    "require": {
        "php": "^7.1",
        "filp/whoops": "^2.4" // Here
    },
}

像这样删除 filp\whoops

composer remove filp/whoops

然后安装门面/点火

composer require --dev facade/ignition

推荐阅读