composer install error [ErrorException] "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
U:\app>composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
[ErrorException]
"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?
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>]...
Why ?
This seems to happen after upgrading PHP from 5.X to 7.X
Troubleshooting
U:\app>composer diagnose
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys:
Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0 87719BA6 8F3BB723 4E5D42D0 84A14642
Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B 0C708369 153E328C AD90147D AFE50952
OK
Checking composer version: WARNING
You are not running the latest stable version, run `composer self-update` to update (1.4.1 => 1.10.8)
`composer self-update` fails with
U:\app>composer self-update
Updating to version 1.10.8 (stable channel).
Downloading (100%)
[RuntimeException]
SHA384 is not supported by your openssl extension, could not verify the phar file integrity
self-update [-r|--rollback] [--clean-backups] [--no-progress] [--update-keys] [--stable] [--preview] [--snapshot] [--set-channel-only] [--] [<version>]
Solution
The solution is to update composer. If on windows, uninstall it first with the uninstaller if any.
- Windows -
Add & Remove Program > Uninstaller composer.
Re-install latest composer
https://getcomposer.org/Composer-Setup.exe
- Linux -
php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" php -r "if (hash_file('sha384', 'composer-setup.php') === 'e5325b19b381bfd88ce90a5ddb7823406b2a38cff6bb704b0acc289a09c8128d4a8ce2bbafcd1fcbdc38666422fe2806') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" php composer-setup.php php -r "unlink('composer-setup.php');"
Success at last !
U:\app>composer install
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Generating autoload files
Recent Comments