安装包时出错(安装失败,将 ./composer.json 还原为其原始内容。)(Laravel 管理包 - Voyager)[重复]

Posted

技术标签:

【中文标题】安装包时出错(安装失败,将 ./composer.json 还原为其原始内容。)(Laravel 管理包 - Voyager)[重复]【英文标题】:Error installing package (Installation failed, reverting ./composer.json to its original content.) (Laravel admin package - Voyager) [duplicate] 【发布时间】:2020-05-22 12:28:55 【问题描述】:

我想安装一个 laravel 管理包 -voyager 1.3 版,所以当我运行这个 cmd $ composer require tcg/voyager 时,我总是得到这个错误,是关于文件 composer.json

Using version ^1.3 for tcg/voyager
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
    - tcg/voyager v1.3.0 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
    - tcg/voyager v1.3.1 requires intervention/image ^2.4 -> satisfiable by intervention/image[2.4.0, 2.4.1, 2.4.2, 2.4.3, 2.5.0, 2.5.1].
   - intervention/image 2.4.3 requires ext-fileinfo * -> the requested php extension fileinfo is missing from your system.
    - intervention/image 2.4.2 requires ext-fileinfo * -> the requested PHP extension fileinfo is missing from your system.

    - Installation request for tcg/voyager ^1.3 -> satisfiable by tcg/voyager[v1.3.0, v1.3.1].

  To enable extensions, verify that they are enabled in your .ini files:
    - C:\AppServ\php7\php.ini
  You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.

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

这是文件 composer.json :

    "name": "laravel/laravel",
        "type": "project",
        "description": "The Laravel Framework.",
        "keywords": [
            "framework",
            "laravel"
        ],
        "license": "MIT",
        "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.4",
            "mockery/mockery": "^1.0",
            "nunomaduro/collision": "^3.0",
            "phpunit/phpunit": "^8.0"
        ,
        "config": 
            "optimize-autoloader": true,
            "preferred-install": "dist",
            "sort-packages": true
        ,
        "extra": 
            "laravel": 
                "dont-discover": []
            
        ,   ..

,你知道怎么解决吗?我的 laravel 版本:6.12

【问题讨论】:

出于好奇:你读过那个错误信息了吗?它非常直接地告诉你该怎么做 【参考方案1】:

尝试在您的php.ini 文件中启用php_fileinfo.dll。只需从下面的行中删除 ; 并重新启动您的服务器

;extension=php_fileinfo.dll

【讨论】:

以上是关于安装包时出错(安装失败,将 ./composer.json 还原为其原始内容。)(Laravel 管理包 - Voyager)[重复]的主要内容,如果未能解决你的问题,请参考以下文章

安装 YamCha 包时出错

尝试安装 imblearn 包时出错

安装 Cairo R 包时出错

为 Linux 安装 R 包时出错

安装失败,将 ./composer.json 还原为其原始内容 [Composer\Repository\InvalidRepositoryException]

500测试monlog包时出错