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.

Laravel6でlaravel/uiがインストールできない

Last updated at Posted at 2021-11-15

#はじめに
Laravel6でlaravel/uiをインストールしようとしたらエラーが出たのでその対処法

#エラー内容
コマンドを実行したら以下の様になった。

ターミナル
**@** docker-laravel % docker-compose exec app composer require laravel/ui
Using version ^3.3 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.3.0, ..., 3.x-dev] require illuminate/console ^8.42 -> found illuminate/console[v8.42.0, ..., 8.x-dev] but these were not loaded, likely because it conflicts with another require.
    - Root composer.json requires laravel/ui ^3.3 -> satisfiable by laravel/ui[v3.3.0, v3.3.1, v3.3.2, 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.

## 解説
composer require laravel/uiは最新のパッケージを拾ってくるみたいです。
調べてみると、Laravel6はlaravel/ui:1.xが対応してるみたいです。
そのため、composer require laravel/uiでlaravel/ui:3.3をインストールしようとしてのエラーが出ています。

#解決法

ターミナル
**@** docker-laravel % docker-compose exec app composer require laravel/ui:^1
./composer.json has been updated
Running composer update laravel/ui
Loading composer repositories with package information
Updating dependencies
Nothing to modify in lock file
Installing dependencies from lock file (including require-dev)
Nothing to install, update or remove
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/ui:1を指定することで、解決しました。

#まとめ
Composer は、バージョンを指定しない場合に最新をインストールとすることを頭に入れなきゃですね。
また、Laravel6を使用する際は互換性にも気をつけないといけないですね。

バージョンを意識するの重要です。

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?