简体   繁体   中英

Installation failed, reverting ./composer.json and ./composer.lock to their original content

I try to install

composer require gloudemans/shoppingcart

package to my laravel project. But i Keep receive this error

Root composer.json requires gloudemans/shoppingcart ^2.6 -> satisfiable by gloudemans/shoppingcart[2.6.0]. - gloudemans/shoppingcart 2.6.0 requires illuminate/support 5.1.* || 5.2.* || 5.3.* || 5.4.* || 5.5. || 5.6. || 5.7.* -> found illuminate/support[v5.1.1, ..., 5.7.x-dev] but it conflicts with another require.

Composer.json

{
    "name": "laravel/laravel",
    "type": "project",
    "description": "The Laravel Framework.",
    "keywords": [
        "framework",
        "laravel"
    ],
    "license": "MIT",
    "require": {
        "php": "^7.3|^8.0",
        "fideloper/proxy": "^4.4",
        "fruitcake/laravel-cors": "^2.0",
        "guzzlehttp/guzzle": "^7.0.1",
        "laravel/framework": "^8.12",
        "laravel/tinker": "^2.5"

    },
    "require-dev": {
        "facade/ignition": "^2.5",
        "fakerphp/faker": "^1.9.1",
        "laravel/ui": "^3.1",
        "mockery/mockery": "^1.4.2",
        "nunomaduro/collision": "^5.0",
        "phpunit/phpunit": "^9.3.3"
    },
    "config": {
        "optimize-autoloader": true,
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "laravel": {
            "dont-discover": []
        }
    },
    "autoload": {
        "psr-4": {
            "App\\": "app/",
            "Database\\Factories\\": "database/factories/",
            "Database\\Seeders\\": "database/seeders/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "Tests\\": "tests/"
        }
    },
    "minimum-stability": "dev",
    "prefer-stable": true,
    "scripts": {
        "post-autoload-dump": [
            "Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
            "@php artisan package:discover --ansi"
        ],
        "post-root-package-install": [
            "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
        ],
        "post-create-project-cmd": [
            "@php artisan key:generate --ansi"
        ]
    }
}

I am a beginner in laravel. Hope anyone provide the solution. Thanks in advance.

As written in the error message: gloudemans/shoppingcart is not compatible with Laravel 8, which you already use in your application. hardevine/shoppingcart or bumbummen99/shoppingcart seem to be forks that were made compatible with any Laravel version since v5.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM