5
4

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 5 years have passed since last update.

Composerでエラーが出たらdiagnoseで診断してみよう

Last updated at Posted at 2019-09-09

Laravelプロジェクトの開発環境構築をやってて、「composer install」したところ、下記のようなエラーが出たので、解決手段をメモ。

vagrant@homestead:~/code/qlara$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating optimized autoload files

  [RuntimeException]
  Could not scan for classes inside "/home/vagrant/code/qlara/vendor/sebastian/object-enumerator/src/" which does not appear to be a file nor a folder

install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--no-suggest] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--apcu-autoloader] [--ignore-platform-reqs] [--] [<packages>]...

エラーの内容からは原因がよくわかりませんね・・・

composer diagnose

composer diagnoseで診断してみます。
composer diagnose.PNG
Checking pubkeysがFAILになってますね。
解決策を提示してくれているので言われた通りに…

composer self-update --update-keys

すると、Public KeyとTags Public Keyを聞かれるので、下記のページからコピペします。
https://composer.github.io/pubkeys.html
※-----も含めテキストエリアの中身を全部コピーします。

その後、再度composer installしたところ、また同じエラーが出たのですが、
vendorディレクトリを一旦削除、キャッシュクリア(composer clear-cache)したらうまくいきました。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?