尝试用PHP 8更新编写器包

  • 本文关键字:更新 PHP php composer-php
  • 更新时间 :
  • 英文 :


在我的开发机器上,我有PHP 8,我试图让Composer升级一些包,但它一直给出关于PHP版本的错误,尽管所有的包都有支持PHP 8的更新。

我不知道如何解决这个问题?

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 abraham/twitteroauth ^1.2 -> satisfiable by abraham/twitteroauth[1.2.0].
- abraham/twitteroauth 1.2.0 requires php ^7.2 || ^7.3 || ^7.4 -> your php version (8.0.9) does not satisfy that requirement.
Problem 2
- guzzlehttp/guzzle 7.0.1 requires php ^7.2.5 -> your php version (8.0.9) does not satisfy that requirement.
- google/apiclient v2.7.2 requires guzzlehttp/guzzle ~5.3.1||~6.0||~7.0 -> satisfiable by guzzlehttp/guzzle[7.0.1].
- google/apiclient is locked to version v2.7.2 and an update of this package was not requested.

<尝试strong>迫使我想要一个新版本,但仍然不能工作:

composer update abraham/twitteroauth:3.0.0
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 abraham/twitteroauth ^1.2, 3.0.0, found abraham/twitteroauth[dev-dependabot/npm_and_yarn/concurrently-6.2.1, dev-dependabot/npm_and_yarn/path-parse-1.0.7, dev-dependabot/npm_and_yarn/prettier/plugin-php-0.17.3, dev-dependabot/composer/phpmd/phpmd-2.10.2, dev-dependabot/composer/phpunit/phpunit-9.5.8, dev-main, dev-master, dev-subdomains, 0.2.1, ..., 0.9.2, 1.0.0, ..., v1.x-dev, 2.0.0, 2.0.1, 2.0.2, 3.0.0, 3.1.0] but it does not match the constraint.

答案是:更新到composer.json中需要的版本。

composer install --ignore-platform-reqs

最新更新