//我的composer.json
{
"name": "laravel/laravel",
"version": "11",
"type": "project",
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.2",
"guzzlehttp/guzzle": "^7.8",
"laracasts/flash": "^3.2",
"laravel/framework": "^11.9",
"laravel/tinker": "^2.9"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"phpunit/phpunit": "^11.0.1"
},
//我的命令提示符
C:\Users\projet\eshop>composer require gloudemans/shoppingcart
./composer.json has been updated
Running composer update gloudemans/shoppingcart
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- gloudemans/shoppingcart[1.0, ..., 1.2.1] require illuminate/support ~4 -> found illuminate/support[v4.0.0, ..., v4.2.17] but these were not loaded, likely because it conflicts with another require.
- gloudemans/shoppingcart 1.3 requires illuminate/support ~5.0 -> found illuminate/support[v5.0.0, ..., v5.8.36] but these were not loaded, likely because it conflicts with another require.
- gloudemans/shoppingcart[2.0.0, ..., 2.1.2] require illuminate/support 5.1.*|5.2.* -> found illuminate/support[v5.1.1, ..., v5.2.45] but these were not loaded, likely because it conflicts with another require.
- gloudemans/shoppingcart[2.2.0, ..., 2.2.4] require illuminate/support 5.1.*|5.2.*|5.3.* -> found illuminate/support[v5.1.1, ..., v5.3.23] but these were not loaded, likely because it conflicts with another require.
- gloudemans/shoppingcart 2.3.0 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.* -> found illuminate/support[v5.1.1, ..., v5.4.36] but these were not loaded, likely because it conflicts with another require.
- gloudemans/shoppingcart 2.4.0 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.*|5.5.* -> found illuminate/support[v5.1.1, ..., v5.5.44] but these were not loaded, likely because it conflicts with another require.
- gloudemans/shoppingcart 2.5.0 requires illuminate/support 5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.* -> found illuminate/support[v5.1.1, ..., v5.6.39] but these were not loaded, likely because it conflicts with another require.
- 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, ..., v5.7.28] but these were not loaded, likely because it conflicts with another require.
- Root composer.json requires gloudemans/shoppingcart * -> satisfiable by gloudemans/shoppingcart[1.0, ..., 1.3, 2.0.0, ..., 2.6.0].
You can also try re-running composer require with an explicit version constraint, e.g. "composer require gloudemans/shoppingcart:*" to figure out if any version is installable, or "composer require gloudemans/shoppingcart:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.
对于我的网上商店项目,我需要将产品添加到购物车。我跑了
composer require g loudemans/shoppingcart
,我得到了这个Installation failed, reverting ./composer.json and ./composer.lock to their original content
我知道这种依赖关系太旧了,但是我该如何修复它?我在互联网上阅读了很多主题,但没有结果。感谢您的帮助,并对我的英语感到抱歉。
选项 1:使用叉子或替代包 一些开发人员创建了与较新版本的 Laravel 兼容的分叉或替代包:
运行:
composer require bumbummen99/shoppingcart
选项 2:使用更新的购物车包
运行:
composer require darryldecode/cart
运行:
composer require devmarketer/shoppingcart