WSL2下Ubuntu 22.04系统
PHP8.1
新创建的项目安装命令行后安装Cache
报错,增加-W
参数后可正常安装。但是换过来先安装Cache
后安装命令行则能正常安装,大佬看看是啥情况。。。
./composer.json has been updated
Running composer update psr/container illuminate/redis symfony/cache
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires psr/container ^1.1.1, found psr/container[1.1.1, 1.1.2] but these were not loaded, likely because it conflicts with another require.
Problem 2
- workerman/webman-framework is locked to version v1.5.0 and an update of this package was not requested.
- workerman/webman-framework v1.5.0 requires psr/container >=1.0 -> found psr/container[1.0.0, 1.1.0, 1.1.1, 1.1.2, 2.0.0, 2.0.1, 2.0.2] but these were not loaded, likely because it conflicts with another require.
Problem 3
- symfony/contracts[v1.1.1, ..., v1.1.8] require php ^7.1.3 -> your php version (8.1.12) does not satisfy that requirement.
- symfony/contracts[v1.1.9, ..., v1.1.13] require psr/container ^1.0 -> found psr/container[1.0.0, 1.1.0, 1.1.1, 1.1.2] but these were not loaded, likely because it conflicts with another require.
- symfony/service-contracts v3.2.0 requires psr/container ^2.0 -> found psr/container[2.0.0, 2.0.1, 2.0.2] but it conflicts with your root composer.json require (^1.1.1).
- webman/console v1.2.19 requires symfony/console >=5.0 -> satisfiable by symfony/console[v6.2.5].
- symfony/console v6.2.5 requires symfony/service-contracts ^1.1|^2|^3 -> satisfiable by symfony/service-contracts[v3.2.0], symfony/contracts[v1.1.1, ..., v1.1.13].
- webman/console is locked to version v1.2.19 and an update of this package was not requested.
Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.
You can also try re-running composer require with an explicit version constraint, e.g. "composer require illuminate/redis:*" to figure out if any version is installable, or "composer require illuminate/redis:^2.1" if you know which you need.
Installation failed, reverting ./composer.json and ./composer.lock to their original content.