4
1

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.

【Laravel UIのインストール】Your requirements could not be resolved to an installable set of packages.と出たとき

Last updated at Posted at 2021-12-04

LaravelのアプリでReactを使いたくてLaravel UIをインストールする際にエラーとなってしまいました。
その際の覚書きです。

実行環境

  • macOS Catalina 10.15.7
  • Composer 2.1.12
  • Laravel 6.20.40

実行コマンドとエラー内容

実行コマンド

$ composer require laravel/ui

結果

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

  Problem 1
    - laravel/ui[v3.4.0, ..., 3.x-dev] require illuminate/console ^8.42|^9.0 -> found illuminate/console[dev-master, v8.42.0, ..., 8.x-dev, 9.x-dev (alias of dev-master)] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires laravel/ui ^3.4 -> satisfiable by laravel/ui[v3.4.0, 3.x-dev].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require laravel/ui:*" to figure out if any version is installable, or "composer require laravel/ui:^2.1" if you know which you need.

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

結論

調べたところ,Laravel UIとLaravelは対応するバージョンが決まっているようです。

Laravel UI Laravel
1.x 5.8、6.x
2.x 7.x
3.x 8.x

自分の使ってるLaravel6.20.40に対応したバージョン1.0を指定してインストール

$ composer require laravel/ui:^1.0 --dev

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

./composer.json has been updated
Running composer update laravel/ui
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 0 removals
  - Locking laravel/ui (v1.3.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
  - Downloading laravel/ui (v1.3.0)
  - Installing laravel/ui (v1.3.0): Extracting archive
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi
Discovered Package: facade/ignition
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: laravel/ui
Discovered Package: nesbot/carbon
Discovered Package: nunomaduro/collision
Package manifest generated successfully.
68 packages you are using are looking for funding.
Use the `composer fund` command to find out more!

余談

この後,Laravelのバージョンを7.30.5に変更したので,Laravel UIのバージョンも2.0に変更しました。

4
1
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
4
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?