Composer 错误,然后尝试使用官方 github 安装 API 平台

问题描述 投票:0回答:1

所以,我完成了此文档中的所有步骤https://api-platform.com/docs/distribution/

  1. 安装实际版本3.2.2
  2. 启动docker作曲家 但是当我尝试启动 docker 容器时
    docker compose up --wait
    我得到了这些:
api-platform-322-php-1       | Installing dependencies from lock file (including require-dev)
api-platform-322-php-1       | Verifying lock file contents can be installed on current platform.
api-platform-322-php-1       | Your lock file does not contain a compatible set of packages. Please run composer update.
api-platform-322-php-1       | 
api-platform-322-php-1       |   Problem 1
api-platform-322-php-1       |     - lcobucci/jwt is locked to version 5.0.0 and an update of this package was not requested.
api-platform-322-php-1       |     - lcobucci/jwt 5.0.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.3.0) does not satisfy that requirement.
api-platform-322-php-1       |   Problem 2
api-platform-322-php-1       |     - lcobucci/jwt 5.0.0 requires php ~8.1.0 || ~8.2.0 -> your php version (8.3.0) does not satisfy that requirement.
api-platform-322-php-1       |     - symfony/mercure-bundle v0.3.7 requires lcobucci/jwt ^3.4|^4.0|^5.0 -> satisfiable by lcobucci/jwt[5.0.0].
api-platform-322-php-1       |     - symfony/mercure-bundle is locked to version v0.3.7 and an update of this package was not requested.

什么也不起作用。我不明白出了什么问题,因为我什么也没改变。 我的系统:Fedora 39

我尝试使用

docker system prune -a
清除 docker 缓存。这没有帮助(

php docker composer-php api-platform.com
1个回答
0
投票

错误消息告诉您容器使用的 PHP 版本是 8.3,但

lcobucci/jwt
供应商需要 8.1 或 8.2。

容器在启动时运行

composer install
命令,从而引发此错误。

这是 API 平台团队的错误。

一个简单的解决方法是编辑文件

api/Dockerfile
并替换第一条指令:

FROM dunglas/frankenphp:latest-alpine AS frankenphp_upstream

FROM dunglas/frankenphp:latest-php8.2-alpine AS frankenphp_upstream
© www.soinside.com 2019 - 2024. All rights reserved.