BLOG
【コピペで即解決】Laravelでcomposer install、composer updateでのエラー解決方法
Laravelで、composer install もしくは composer update 等のコマンドを実行した際に、以下のようなエラーが出てしまった時の対処方法です。
Deprecation Notice: Required parameter $path follows optional parameter $schema in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:62 Deprecation Notice: Required parameter $path follows optional parameter $schema in phar:///usr/local/bin/composer/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/UndefinedConstraint.php:108 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130 Deprecation Notice: Method ReflectionParameter::getClass() is deprecated in phar:///usr/local/bin/composer/src/Composer/Repository/RepositoryManager.php:130 Loading composer repositories with package information Warning from https://repo.packagist.org: Support for Composer 1 is deprecated and some packages will not be available. You should upgrade to Composer 2. See https://blog.packagist.com/deprecating-composer-1-support/ Updating dependencies (including require-dev)
見てるだけで思考停止するようなエラーですが、以下の「composer自体のバージョンをアップデートするコマンド」と「各ファイルを最新版にアップデートするコマンド」の2つのコマンドを実行すると一撃で解決できます。
1.composer自体のバージョンをアップデート
$ composer self-update
2.composer.jsonをもとに各ファイルを最新版にアップデート
$ composer update
これでエラーが出なくなったのではないかと思います。