前提
Laravel環境にて、fakerを使用して、ダミーの画像データを生成しようとしているのですが、エラーが出ます。
調べてみるとどうやら、composer require --dev mmo/faker-imagesをインストールしないと現在はダミーの画像データを作ることができないみたいです。
下記のコマンドでライブラリをインストールしようとすると依存関係のエラーが発生してしまいインストールできません。
shell
1composer require --dev mmo/faker-images
実現したいこと
- mmo/faker-imagesをインストールする
発生している問題・エラーメッセージ
shell
1Info from https://repo.packagist.org: #StandWithUkraine 2Using version ^0.6.0 for mmo/faker-images 3./composer.json has been updated 4Running composer update mmo/faker-images 5Loading composer repositories with package information 6Updating dependencies 7Your requirements could not be resolved to an installable set of packages. 8 9 Problem 1 10 - symfony/deprecation-contracts v3.1.1 requires php >=8.1 -> your php version (8.0.19) does not satisfy that requirement. 11 - fakerphp/faker v1.20.0 requires symfony/deprecation-contracts ^2.2 || ^3.0 -> satisfiable by symfony/deprecation-contracts[v3.1.1]. 12 - fakerphp/faker is locked to version v1.20.0 and an update of this package was not requested. 13 14You can also try re-running composer require with an explicit version constraint, e.g. "composer require mmo/faker-images:*" to figure out if any version is installable, or "composer require mmo/faker-images:^2.1" if you know which you need. 15 16Installation failed, reverting ./composer.json and ./composer.lock to their original content.
該当のソースコード
composer.json
1 "require": { 2 "php": "^8.0.2", 3 "guzzlehttp/guzzle": "^7.2", 4 "laravel-lang/lang": "~10.3", 5 "laravel/framework": "^9.19", 6 "laravel/sanctum": "^3.0", 7 "laravel/tinker": "^2.7" 8 }, 9 "require-dev": { 10 "fakerphp/faker": "^1.9.1", 11 "laravel/breeze": "^1.13", 12 "laravel/pint": "^1.0", 13 "laravel/sail": "^1.0.1", 14 "mockery/mockery": "^1.4.4", 15 "nunomaduro/collision": "^6.1", 16 "phpunit/phpunit": "^9.5.10", 17 "spatie/laravel-ignition": "^1.0" 18 },
試したこと
下記のように指定してインストールも試してみましたがエラーが出ます。
shell
1$ composer require mmo/faker-images:* 2zsh: no matches found: mmo/faker-images:*
packagistのサイトを見て依存関係を見てみたのですが、
phpのバージョン8.0以上9未満に収まっていますし 、fakerphp/fakerのバージョンも1.9以上2.0未満に収まってるので何が良くないのでしょうか。
補足情報(FW/ツールのバージョンなど)
faker-imagesのgithub
https://github.com/morawskim/faker-images
packagistのURL
https://packagist.org/packages/mmo/faker-images
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2022/10/11 17:08 編集