Composer php composer:在使用PHP8之后,您的需求无法解析为一组可安装的包

Composer php composer:在使用PHP8之后,您的需求无法解析为一组可安装的包,composer-php,Composer Php,大家好,我正在迁移PHP8并将composer更新到版本2。当我尝试更新我的依赖项时,出现了错误: Your requirements could not be resolved to an installable set of packages Problem 1 - prooph/service-bus is locked to version v6.2.2 and an update of this package was not requested.

大家好,我正在迁移PHP8并将composer更新到版本2。当我尝试更新我的依赖项时,出现了错误:

    Your requirements could not be resolved to an installable set of packages
    Problem 1
     - prooph/service-bus is locked to version v6.2.2 and an update of this package was not requested.
     - prooph/service-bus v6.2.2 requires php ^7.1 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 2
      - prooph/event-sourcing is locked to version v5.6.0 and an update of this package was not requested.
        - prooph/event-sourcing v5.6.0 requires php ^7.1 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 3
        - prooph/pdo-event-store is locked to version v1.12.0 and an update of this package was not requested.
        - prooph/pdo-event-store v1.12.0 requires php ^7.1 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 4
        - prooph/event-store-bus-bridge is locked to version v3.3.0 and an update of this package was not requested.
        - prooph/event-store-bus-bridge v3.3.0 requires php ^7.1 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 5
        - prooph/snapshotter is locked to version v2.1.0 and an update of this package was not requested.
        - prooph/snapshotter v2.1.0 requires php ^7.1 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 6
        - prooph/pdo-snapshot-store is locked to version v1.5.2 and an update of this package was not requested.
        - prooph/pdo-snapshot-store v1.5.2 requires php ^7.1 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 7
        - zendframework/zend-escaper is locked to version 2.6.1 and an update of this package was not requested.
        - zendframework/zend-escaper 2.6.1 requires php ^5.6 || ^7.0 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 8
        - spatie/ssl-certificate-chain-resolver is locked to version 2.0.3 and an update of this package was not requested.
        - spatie/ssl-certificate-chain-resolver 2.0.3 requires php ^7.0 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 9
        - phpdocumentor/reflection-docblock is locked to version 4.3.4 and an update of this package was not requested.
        - phpdocumentor/reflection-docblock 4.3.4 requires php ^7.0 -> your php version (8.0.1-dev) does not satisfy that requirement.
      Problem 10
        - paragonie/random_compat v9.99.99 requires php ^7 -> your php version (8.0.1-dev) does not satisfy that requirement.
        - ramsey/uuid 3.9.3 requires paragonie/random_compat ^1 | ^2 | 9.99.99 -> satisfiable by paragonie/random_compat[v9.99.99].
        - ramsey/uuid is locked to version 3.9.3 and an update of this package was not requested."
据我所知,这个错误意味着我的一些软件包还没有为PHP8做好准备。如何更新已准备就绪的软件包

我尝试为prooph组件更新composer.json

"require": {
        "php": "^7.1",
        "prooph/common" : "^4.0.0"
    }

并运行命令
composer.phar update--lock--with all dependencies
,但它没有帮助

当我试图通过“composer.phar update vimeo/psalm 4.4”更新vimeo/psalm时,我得到了相同的错误。这是否意味着prooph需要旧版的《诗篇》而不允许更新

如何解决此问题并更新所有已准备好的

My composer.json文件:

 {
        "require": {
            "php-amqplib/php-amqplib": ">=2.8",
            "prooph/service-bus": "^6.2",
            "prooph/event-sourcing": "^5.6",
            "prooph/event-store": "^7.5",
            "prooph/pdo-event-store": "^1.10",
            "prooph/event-store-bus-bridge": "^3.3",
            "prooph/snapshotter": "^2.1",
            "prooph/pdo-snapshot-store": "^1.5",
            "psr/container": "^1.0",
            "zendframework/zend-escaper": "^2.6",
            "spatie/ssl-certificate-chain-resolver": "^2.0",
            
            "webmozart/glob": "^4.1",
            "webmozart/path-util": "^2.3",
            "webmozart/assert": "^1.5",
            "vimeo/psalm":  "^3.5.1",
            "sebastian/diff": "^3.0",
            "psr/log": "^1.1",
            "phpdocumentor/type-resolver": "^1.0",
            "phpdocumentor/reflection-docblock": "^4.3",
            "phpdocumentor/reflection-common": "^2.0",
            "openlss/lib-array2xml": "^1.0",
            "ocramius/package-versions": "^1.4",
            "nikic/php-parser": "^4.2",
            "netresearch/jsonmapper": "^1.6",
            "felixfbecker/language-server-protocol": "^1.4",
            "felixfbecker/advanced-json-rpc": "^3.0",
            "composer/xdebug-handler": "^1.3",
            "amphp/byte-stream": "^1.6",
            "amphp/amp": "^2.2",
            "symfony/service-contracts": "^1.1",
            "symfony/polyfill-php73": "^1.11",
            "symfony/polyfill-mbstring": "^1.11",
            "symfony/polyfill-ctype": "^1.12",
            "symfony/console": "^4.3",
            
            "ramsey/uuid": "^3.8",
              "ext-json": "*",
              "ext-openssl": "*",
              "ext-mysqli": "*",
              "ext-dom": "*",
              "ext-curl": "*",
          "ext-pcntl": "*",
          "ext-posix": "*",
            "symfony/http-foundation": "^5.1",
            "symfony/routing": "^5.1",
            "ocramius/proxy-manager": "^2.2",
            "react/promise": "^2.8",
            "psr/event-dispatcher": "^1.0",
          "ext-ftp": "*",
          "ext-iconv": "*"
        },
        "autoload": {
            "classmap": [
                            "vendor/acme_nc/ACMECert.php",
                            "vendor/roundcube/roundcubeAutoLogin.php"
                        ]
        }
    }

非常简单,以下两行说明了一切:

  • prooph/service bus已锁定到v6.2.2版本,未请求更新此软件包
  • prooph/service bus v6.2.2需要php^7.1->您的php版本(8.0.1-dev)不满足该要求
因此,没有与PHP8兼容的版本。正如一位维护人员在a中所写的,这个包将不会有新版本



应该可以通过更新您的
composer.json
来更新其他包。由于您尚未共享配置的当前状态,因此无法告诉您需要更改什么,但最简单的方法是一行接一行,在packagist.org上检查更新,并调整版本约束。但是请注意,您很可能会运行一些主要的升级。拥有一个好的测试套件有助于检查哪些升级会导致哪些问题

我添加了composer.json您是想更改composer.json文件中包的版本,还是尝试执行composer update package/name new_version?如果您想更新包,使其超出composer.json中给出的限制,您需要将composer.jsonI updated composer.json更新为“vimeo/psalm”:“^4.4”并运行composer update vimeo/psalm,得到与“相同错误”相同的错误?通过更新任何其他包,您仍然不能使用PHP8,因为每个包都必须兼容!谢谢!我对composer.json文件有误解。这是我的主要问题。我在文件中更改了所需软件包的版本并进行了更新。
 {
        "require": {
            "php-amqplib/php-amqplib": ">=2.8",
            "prooph/service-bus": "^6.2",
            "prooph/event-sourcing": "^5.6",
            "prooph/event-store": "^7.5",
            "prooph/pdo-event-store": "^1.10",
            "prooph/event-store-bus-bridge": "^3.3",
            "prooph/snapshotter": "^2.1",
            "prooph/pdo-snapshot-store": "^1.5",
            "psr/container": "^1.0",
            "zendframework/zend-escaper": "^2.6",
            "spatie/ssl-certificate-chain-resolver": "^2.0",
            
            "webmozart/glob": "^4.1",
            "webmozart/path-util": "^2.3",
            "webmozart/assert": "^1.5",
            "vimeo/psalm":  "^3.5.1",
            "sebastian/diff": "^3.0",
            "psr/log": "^1.1",
            "phpdocumentor/type-resolver": "^1.0",
            "phpdocumentor/reflection-docblock": "^4.3",
            "phpdocumentor/reflection-common": "^2.0",
            "openlss/lib-array2xml": "^1.0",
            "ocramius/package-versions": "^1.4",
            "nikic/php-parser": "^4.2",
            "netresearch/jsonmapper": "^1.6",
            "felixfbecker/language-server-protocol": "^1.4",
            "felixfbecker/advanced-json-rpc": "^3.0",
            "composer/xdebug-handler": "^1.3",
            "amphp/byte-stream": "^1.6",
            "amphp/amp": "^2.2",
            "symfony/service-contracts": "^1.1",
            "symfony/polyfill-php73": "^1.11",
            "symfony/polyfill-mbstring": "^1.11",
            "symfony/polyfill-ctype": "^1.12",
            "symfony/console": "^4.3",
            
            "ramsey/uuid": "^3.8",
              "ext-json": "*",
              "ext-openssl": "*",
              "ext-mysqli": "*",
              "ext-dom": "*",
              "ext-curl": "*",
          "ext-pcntl": "*",
          "ext-posix": "*",
            "symfony/http-foundation": "^5.1",
            "symfony/routing": "^5.1",
            "ocramius/proxy-manager": "^2.2",
            "react/promise": "^2.8",
            "psr/event-dispatcher": "^1.0",
          "ext-ftp": "*",
          "ext-iconv": "*"
        },
        "autoload": {
            "classmap": [
                            "vendor/acme_nc/ACMECert.php",
                            "vendor/roundcube/roundcubeAutoLogin.php"
                        ]
        }
    }