php - 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
解决方案
我通过首先运行 composer outdated -D 并手动更新 composer.json 中的 laravel/framework 的版本,然后运行 composer update 解决了这个问题。
推荐阅读
- azure - Azure 机器学习(预览版)到客户洞察
- javascript - 通过滚动文本定位粘性循环
- postgresql - 使用 postgres 后端在 apache 超集上链接正则表达式替换
- c++ - Clang vs G++ 左值到右值转换
- java - Spring Boot 中的计数器
- linux - 用于从某个点(字符)替换文件名中的文本的重命名命令,但仅限于并保持文件扩展名
- android - 无法从 CoroutineScope 启动访问挂起 Dao 功能
- json - 如何在带有 swiftUI 列表的切换中使用 json 属性?
- java - 尝试使用 GSON API 读取 json 时出现空指针异常
- rust - 处理 macro_rules 中的可选模式