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

Composerでパッケージを管理する方法を勉強しててエラーがなかなか解消されなくて念の為備忘録的な感じで。

目次

今回の問題点

PhpSpreadsheetというPHPでExcel形式ファイルを読み書きするためのパッケージをインストールするためにコマンドを叩いてみたけど、下記のエラーが出てなかなか解消されない。

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

Problem 1
- Root composer.json requires PHP extension ext-zip * but it is missing from your system. Install or enable PHP's zip extension.
Problem 2
- phpoffice/phpspreadsheet[1.17.0, …, 1.17.1] require ext-zip * -> it is missing from your system. Install or enable PHP's zip extension.
- Root composer.json requires phpoffice/phpspreadsheet ^1.17 -> satisfiable by phpoffice/phpspreadsheet[1.17.0, 1.17.1].

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

zipがないとかが問題でなってるとかどうとか書かれてたけど・・・解消してもなかなかうまくいかなかったため念の為備忘録として。

本を読みながら方法を再度考えよう。

composer require <パッケージ名> "バージョン指定" --ignore-platform-reqs

で解消。--ignore-platform-reqsでPHPバージョンのチェックを一時的に回避するオプションだそうなので、根本的な原因解決にならないのかな・・・

参考ページ

https://qiita.com/mprumem/items/f20a811db219bb372ab6

よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

この記事を書いた人

コメント

コメントする

目次