Help us understand the problem. What is going on with this article?

composer installができなくなった時の解決法(PHP7.3)

More than 1 year has passed since last update.

PHP7.3にしたら、composer installができなくなった。
(PHP7.2に下げれば根本解決するらしいです。)

$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)


  [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] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--] [<packages>]...

  

Google翻訳さんに聞いたら、

"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?   
→ 「continue」ターゲティングスイッチは「break」と同じです。 "continue 2"を使用するつもりでしたか?  

とのことらしいです。どっかで使ってるんでしょうね。。。。
PHP 7.3から”break”の代わりに”continue”は使えなくなるらしいです。

参考:https://blog.ohgaki.net/php-7-3#continue

  

 解決策

  • composerのバージョンが古い場合、composerのバージョンをあげる。

※composerのバージョンが新しい場合はこちら
【2019年1月現在】PHP7.3でcomposerが使えなくなるバグの対策

 
composerのバージョンを確認。

$ composer -V
Composer version 1.1.2 2016-05-31 19:48:11

composer自体のバージョンをあげる。

$ composer self-update
Updating to version 1.8.0 (stable channel).
    Downloading: 100%         
Use composer self-update --rollback to return to version 1.1.2
$ composer -V
Composer version 1.8.0 2018-12-03 10:31:16

composer install できた!

$ composer install
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 28 installs, 0 updates, 0 removals

  - Installing sebastian/version (2.0.1): Loading from cache
....

Writing lock file
Generating autoload files
kin29ma_n
PHPerです!PHPとGASがすきです。
quartetcom
リスティング広告運用総合支援ツール「Lisket」を開発・運営しています。
http://tech.quartetcom.co.jp/
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした