首页 > 解决方案 > Composer 2.0 Problems

问题描述

Recently i attempted to install a package on a project i work on via Composer. Upon installing i was prompted a message that Composer 2.0 is released and asked me if i want to update it. Normally it seemed like a stable release but upon update the package wasnt installed and this error poped up.

composer require spatie/laravel-tags
Using version ^3.0 for spatie/laravel-tags
./composer.json has been updated
Running composer update spatie/laravel-tags
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 laravel/framework 8.0, found laravel/framework[v8.0.0] but the package is fixed to v7.30.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
  Problem 2
- spatie/laravel-tags[3.0.0, ..., 3.0.1] require laravel/framework ^8.0 -> found laravel/framework[v8.0.0, ..., 8.x-dev] but the package is fixed to v7.30.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
- Root composer.json requires spatie/laravel-tags ^3.0 -> satisfiable by spatie/laravel-tags[3.0.0, 3.0.1].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

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

Anyone experienced this issue or have any guidelines how can i fix this?

Thanks

标签: phplaravelpackagecomposer-phpversion

解决方案


我通过首先运行 composer outdated -D 并手动更新 composer.json 中的 laravel/framework 的版本,然后运行 ​​composer update 解决了这个问题。


推荐阅读