gpt4 book ai didi

docker - Composer 无法加载包无效的版本字符串

转载 作者:行者123 更新时间:2023-12-02 17:58:58 25 4
gpt4 key购买 nike

我遇到了范围情况,当我尝试在本地安装一些包时,我遇到了错误,但是当我尝试在测试服务器中安装相同的包时,所有安装都没有错误。我使用 docker-compose 并在图像中安装包。 docker-copose 和其他所有依赖项绝对相同的 docker 文件,都在 git 中。composer require league/flysystem-bundle在本地我遇到了那个
使用版本 dev-master 进行联盟/flysystem-bundle
./composer.json 已更新
使用包信息加载 Composer 存储库
更新依赖项(包括 require-dev)
将“symfony/symfony”中列出的软件包限制为“5.0.*”
安装失败,将 ./composer.json 恢复为其原始内容。

  [RuntimeException]                                                           
Could not load package ezsystems/ezplatform in http://repo.packagist.org: [
UnexpectedValueException] Could not parse version constraint dev-load-varni
sh-only-when-used as ^2.0@dev: Invalid version string "^2.0@dev"



[UnexpectedValueException]
Could not parse version constraint dev-load-varnish-only-when-used as ^2.0@
dev: Invalid version string "^2.0@dev"
本地 Composer 版本 Composer 版本 1.10.11 2020-09-08 16:53:44
和测试服务器
/var/www/symfony # composer require league/flysystem-bundle
Using version dev-master for league/flysystem-bundle
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Restricting packages listed in "symfony/symfony" to "5.0.*"

Prefetching 3 packages 🎶 💨
- Downloading (100%)

Package operations: 3 installs, 0 updates, 0 removals
- Installing league/mime-type-detection (1.4.0): Loading from cache
- Installing league/flysystem (1.x-dev 53f16fd): Loading from cache
- Installing league/flysystem-bundle (dev-master 525845a): Loading from cache
Package easycorp/easy-log-handler is abandoned, you should avoid using it. No replacement was suggested.
Package zendframework/zend-code is abandoned, you should avoid using it. Use laminas/laminas-code instead.
Package zendframework/zend-eventmanager is abandoned, you should avoid using it. Use laminas/laminas-eventmanager instead.
Writing lock file
Generating autoload files
20 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Symfony operations: 1 recipe (c67222ac592a52b7dec1c2cd56763685)
- WARNING league/flysystem-bundle (>=1.0): From github.com/symfony/recipes-contrib:master
The recipe for this package comes from the "contrib" repository, which is open to community contributions.
Review the recipe at https://github.com/symfony/recipes-contrib/tree/master/league/flysystem-bundle/1.0

Do you want to execute this recipe?
[y] Yes
[n] No
[a] Yes for all packages, only for the current installation session
[p] Yes permanently, never ask again for this project
(defaults to n):
ocramius/package-versions: Generating version class...
ocramius/package-versions: ...done generating version class
Executing script cache:clear [OK]
Executing script assets:install public [OK]
测试服务器 Composer 版本 Composer 版本 1.10.10 2020-08-03 11:35:19
我的 dockerfile
FROM alpine:edge

LABEL maintainer="Vincent Composieux <vincent.composieux@gmail.com>"

RUN apk add --update --no-cache \
coreutils \
yarn \
php7-fpm \
php7-apcu \
php7-ctype \
php7-curl \
php7-dom \
php7-gd \
php7-iconv \
php7-imagick \
php7-json \
php7-intl \
php7-mcrypt \
php7-fileinfo\
php7-mbstring \
php7-opcache \
php7-openssl \
php7-pdo \
php7-pdo_mysql \
php7-mysqli \
php7-pdo_pgsql \
php7-pgsql \
php7-xml \
php7-zlib \
php7-phar \
php7-tokenizer \
php7-session \
php7-simplexml \
php7-xdebug \
php7-zip \
php7-xmlwriter \
make \
curl \
zlib-dev \
libxml2-dev \
rabbitmq-c-dev \
oniguruma-dev \
php7-pecl-amqp \
php7-amqp \
php7-redis

RUN apk add --no-cache --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing/ php7-pecl-mongodb

RUN echo "$(curl -sS https://composer.github.io/installer.sig) -" > composer-setup.php.sig \
&& curl -sS https://getcomposer.org/installer | tee composer-setup.php | sha384sum -c composer-setup.php.sig \
&& php composer-setup.php && rm composer-setup.php* \
&& chmod +x composer.phar && mv composer.phar /usr/bin/composer

COPY symfony.ini /etc/php7/conf.d/
COPY symfony.ini /etc/php7/cli/conf.d/
COPY xdebug.ini /etc/php7/conf.d/

COPY symfony.pool.conf /etc/php7/php-fpm.d/

CMD ["php-fpm7", "-F"]

WORKDIR /var/www/symfony
EXPOSE 9001

为什么同时我面对不同版本的 Composer 。 Composer 以相同的方式安装,由相同的 Dockerfile 安装。如何解决这个问题?
我不相信,这怎么可能,使用 docker 结构时不应该出现这个问题..?

最佳答案

看起来 Composer 1.10.11 已损坏。您可以像这样切换到 1.10.10:

composer-setup.php --version=1.10.10

关于docker - Composer 无法加载包无效的版本字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63801165/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com