我在我的商店软件项目中遇到了 composer 的问题。在编写器安装或编写器更新后,我收到以下错误:
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update <package name>`.
- Required package "shopware/core" is not present in the lock file.
- Required (in require-dev) package "phpunit/phpunit" is in the lock file as "9.5.2" but that does not satisfy your constraint "~9.5.17".
This usually happens when composer files are incorrectly merged or the composer.json file is manually edited.
Read more about correctly resolving merge conflicts https://getcomposer.org/doc/articles/resolving-merge-conflicts.md
and prefer using the "require" command over editing the composer.json file directly https://getcomposer.org/doc/03-cli.md#require-r
Script @composer install --working-dir vendor/shopware/recovery --no-interaction --no-scripts handling the post-update-cmd event returned with error code 4
删除composer.lock没有帮助。有人知道发生什么事了吗?
“composer update”->应该可以正常工作而不会出错
1条答案
按热度按时间nafvub8i1#
对我来说,这是一种变通方法,将 composer 版本从最新的
composer self-update 2.4.4
更改为稍旧的composer self-update 2.4.4
,如DevertNet所建议的(文章:https://github.com/shopware/production/issues/168)。但是shyim的回答详细解释了如何从源头上解决问题(下面的解决方案)。1.更新composer.json文件(删除带“-”的行)
1.更新至Flex模板-Flex模板不再包含恢复。https://www.shopware.com/en/news/shopware-goes-symfony-flex/
1.在该文件夹中运行composer update
composer update -d vendor/shopware/recovery/Common/