端くれプログラマの備忘録 PHP [PHP] composerでocramius/package-versionsのインストールに失敗する

[PHP] composerでocramius/package-versionsのインストールに失敗する

$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Package operations: 139 installs, 0 updates, 0 removals
- Installing ocramius/package-versions (1.4.0): Loading from cache
Plugin installation failed, rolling back
- Removing ocramius/package-versions (1.4.0)
[RuntimeException]
Could not delete /home/vagrant/code/myproject/vendor/ocramius/package-versions/src/PackageVersions:
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 plugin installation failed · Issue #1240 · laravel/homestead · GitHub
https://github.com/laravel/homestead/issues/1240

以下のようにオプションを追加してエラー回避。

$ composer install --no-plugins --no-scripts