0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

goutteインストールのバージョンエラー解決

Posted at
 composer require weidner/goutte

したところ、以下のエラーが出た。

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - fabpot/goutte[v3.2.0, ..., v3.2.1] require symfony/css-selector ~2.1|~3.0 -> found symfony/css-selector[v2.1.0, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev] but the package is fixed to v5.4.19 (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.
    - fabpot/goutte[v3.2.2, ..., v3.2.3] require symfony/css-selector ~2.1|~3.0|~4.0 -> found symfony/css-selector[v2.1.0, ..., 2.8.x-dev, v3.0.0-BETA1, ..., 3.4.x-dev, v4.0.0-BETA1, ..., 4.4.x-dev] but the package is fixed to v5.4.19 (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.
    - fabpot/goutte[v3.3.0, ..., v3.3.1] require guzzlehttp/guzzle ^6.0 -> found guzzlehttp/guzzle[6.0.0, ..., 6.5.x-dev] but the package is fixed to 7.5.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.
    - weidner/goutte 1.6.0 requires fabpot/goutte ^3.2 -> satisfiable by fabpot/goutte[v3.2.0, ..., v3.3.1].
    - Root composer.json requires weidner/goutte 1.6 -> satisfiable by weidner/goutte[1.6.0].

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.

どうやらバージョンが違うと怒られているらしい。
Laravelのバージョンを確認

php aritsan -V 

私のバージョンは7.~でした。
バージョン7あたりはGoutteのバージョン1.6でいい様子。
今度はバージョンを指定してみる。

 composer require weidner/goutte:1.6

また冒頭と同じエラーが。
仕方なくcomposer.jsonを編集

"require": {
        ~~,
        "weidner/goutte": "^1.6"
    },

コマンド実行

composer update

解決できました。

参考:https://halfpower.work/2022/09/18/goutte%E3%81%AE%E3%83%90%E3%83%BC%E3%82%B8%E3%83%A7%E3%83%B3%E3%81%AE%E8%A7%A3%E6%B1%BA%E3%81%AE%E4%BB%95%E6%96%B9/

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?