ポンコツエンジニアのごじゃっぺ開発日記。

いろいろポンコツだけど、気にするな。エンジニアの日々の開発などの記録を残していきます。 自動で収入を得られるサービスやシステムを作ることが目標!!

composer require symfony/pantherでエラーになった問題の解消【PHP】

composerでsymfony/pantherのインストールがエラーになったので、その解消方法のメモになります。

$ composer require symfony/panther
Using version ^1.1 for symfony/panther
./composer.json has been updated
Running composer update symfony/panther
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - symfony/panther[v1.1.0, ..., v1.1.1] require symfony/deprecation-contracts ^2.4 -> found symfony/deprecation-contracts[v2.4.0] but the package is fixed to v2.2.0 (lock file version) by a partial update and that version does not match. Make sure you list it as an argument for the update command.
    - Root composer.json requires symfony/panther ^1.1 -> satisfiable by symfony/panther[v1.1.0, v1.1.1].

Use the option --with-all-dependencies (-W) to allow upgrades, downgrades and removals for packages currently locked to specific versions.

Installation failed, reverting ./composer.json and ./composer.lock to their original content.

symfony/deprecation-contractsのバージョンが2.4以上必要だけど、2.2.0になっているよ。って見えます。

$ composer require symfony/deprecation-contracts
Using version ^2.4 for symfony/deprecation-contracts
./composer.json has been updated
Running composer update symfony/deprecation-contracts
Loading composer repositories with package information
Updating dependencies
Lock file operations: 0 installs, 1 update, 0 removals
  - Upgrading symfony/deprecation-contracts (v2.2.0 => v2.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 0 installs, 1 update, 0 removals
  - Upgrading symfony/deprecation-contracts (v2.2.0 => v2.4.0): Extracting archive
Generating autoload files
15 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

たしかに、アップデートできました。

そして、もう一度インストールしてみます。

$ composer require symfony/panther
Using version ^1.1 for symfony/panther
./composer.json has been updated
Running composer update symfony/panther
Loading composer repositories with package information
Updating dependencies
Lock file operations: 3 installs, 0 updates, 0 removals
  - Locking php-webdriver/webdriver (1.11.1)
  - Locking symfony/panther (v1.1.1)
  - Locking symfony/process (v5.3.7)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 3 installs, 0 updates, 0 removals
  - Downloading symfony/process (v5.3.7)
  - Downloading php-webdriver/webdriver (1.11.1)
  - Downloading symfony/panther (v1.1.1)
  - Installing symfony/process (v5.3.7): Extracting archive
  - Installing php-webdriver/webdriver (1.11.1): Extracting archive
  - Installing symfony/panther (v1.1.1): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
17 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

無事インストールできました!

お問い合わせプライバシーポリシー制作物