0

我刚刚删除了我安装的 laravel 文件夹,我在其中轻松安装了 Dingo 和 JWT。Laravel 版本是 5.2.x。

现在,每当我尝试重新安装 Dingo API 时,都会出现错误。这是我使用的命令列表:

安装步骤

  1. 安装 Laravel composer create-project laravel/laravel citycare 5.2.*:. (我也尝试过 5.1.*)
  2. 安装野狗:composer require dingo/api:1.0.x@dev.

这是错误

You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
./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
    - Conclusion: don't install dingo/api 1.0.x-dev
    - Conclusion: don't install dingo/api v1.0.0-beta3
    - Conclusion: remove laravel/framework v5.2.38
    - Installation request for phpdocumentor/reflection-docblock == 3.1.0.0 -> satisfiable by phpdocumentor/reflection-docblock[3.1.0].
    - Conclusion: don't install laravel/framework v5.2.38
    - dingo/api v1.0.0-beta1 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.6, v5.1.8].
    - dingo/api v1.0.0-beta2 requires illuminate/support 5.1.* -> satisfiable by illuminate/support[v5.1.1, v5.1.13, v5.1.16, v5.1.2, v5.1.20, v5.1.22, v5.1.25, v5.1.28, v5.1.30, v5.1.31, v5.1.6, v5.1.8].
    - don't install illuminate/support v5.1.1|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.13|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.16|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.2|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.20|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.22|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.25|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.28|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.30|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.31|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.6|don't install laravel/framework v5.2.38
    - don't install illuminate/support v5.1.8|don't install laravel/framework v5.2.38
    - Installation request for laravel/framework == 5.2.38.0 -> satisfiable by laravel/framework[v5.2.38].
    - Installation request for dingo/api 1.0.x@dev -> satisfiable by dingo/api[1.0.x-dev, v1.0.0-beta1, v1.0.0-beta2, v1.0.0-beta3].


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

6 回答 6

5

Andrey B,我试过了,但这对我不起作用。显然,我决定继续尝试更多的事情以使其发挥作用。这是我找到的解决方案:

"phpdocumentor/reflection": "3.x@dev""require": { }in下添加composer.json并运行了composer update.

在此之后,composer require成功运行。

我仍然无法找到导致此问题的原因。我猜,上次安装时,composer.json 里面已经有 phpdocumentor。

看看我的新的composer.json

{
    "name": "laravel/laravel",
    "description": "The Laravel Framework.",
    "keywords": ["framework", "laravel"],
    "license": "MIT",
    "type": "project",
    "require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "phpdocumentor/reflection": "3.x@dev",
        "dingo/api": "1.0.x@dev",
        "zizaco/entrust": "5.2.x-dev"
    },
    "require-dev": {
        "fzaninotto/faker": "~1.4",
        "mockery/mockery": "0.9.*",
        "phpunit/phpunit": "~4.0",
        "phpspec/phpspec": "~2.1",
        "laracasts/generators": "^1.1"
    },
    "autoload": {
        "classmap": [
            "database"
        ],
        "psr-4": {
            "App\\": "app/"
        }
    },
    "autoload-dev": {
        "classmap": [
            "tests/TestCase.php"
        ]
    },
    "scripts": {
        "post-root-package-install": [
            "php -r \"copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "php artisan key:generate"
        ],
        "post-install-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postInstall",
            "php artisan optimize"
        ],
        "post-update-cmd": [
            "Illuminate\\Foundation\\ComposerScripts::postUpdate",
            "php artisan optimize"
        ]
    },
    "config": {
        "preferred-install": "dist"
    }
}

还要注意我正在使用Laravel 5.1.x.

于 2016-06-21T05:22:38.353 回答
2

我刚刚遇到了同样的问题。通过composer require命令安装失败,但编辑 composer.json 文件然后运行composer update就可以了。

于 2016-06-20T09:50:19.617 回答
1

解决了:

在“require”下添加“phpdocumentor/reflection”:“3.x@dev”:在composer.json中

"require": { "php": ">=5.5.9", "laravel/framework": "5.2.*", "phpdocumentor/reflection": "3.x@dev" },

$ composer update $ composer 需要 dingo/api:1.0.x@dev

成功命令后,这将在“require”下添加“dingo/api”:“1.0.x@dev”:。

"require": { "php": ">=5.5.9", "laravel/framework": "5.2.*", "phpdocumentor/reflection": "3.x@dev", "dingo/api": " 1.0.x@dev" }

于 2016-07-27T05:38:10.670 回答
1

我正在使用 laravel 5.4,当我尝试使用此命令通过终端导入时遇到了同样的问题。" composer require dingo/api:1.0.x@dev"..... 但在那之后我刚刚更新了我的 composer.json 文件,就像这样

"require": {
        "php": ">=5.6.4",
        "dingo/api": "1.0.*@dev",
        "laravel/framework": "5.4.*",
        "laravel/tinker": "~1.0",
        "intervention/image": "dev-master"
    }

之后我运行“composer update”命令并成功导入包帮助链接:https ://github.com/dingo/api/wiki/Installation

于 2017-02-02T09:05:18.550 回答
0

这种方法对我有用:

"require": {
        "php": ">=5.5.9",
        "laravel/framework": "5.1.*",
        "phpdocumentor/reflection": "3.x@dev",
        "dingo/api": "1.0.x@dev"
    },
    
composer update
composer require dingo/api:1.0.x@dev
于 2020-11-06T15:49:57.350 回答
0

您可以将其用于 Dingo 安装

"require": {
    "dingo/api": "2.0.0-alpha1"
}
于 2017-12-14T10:47:59.493 回答