LoginSignup
1
1

More than 5 years have passed since last update.

composer installしたら"continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? となったときの対応方法

Last updated at Posted at 2019-01-20
  • 環境
    • macOS Mojave バージョン10.14.2

事象 : composer installしたら怒られた

composer.json
{
    "name": "tryphp/qiita",
    "description": "Sample For Qiita post.",
    "type": "project",
    "require": {
        "php": "7.3.1"
    },
    "require-dev": {
        "phpunit/phpunit": "7.5.2"
    },
    "license": "MIT",
    "minimum-stability": "dev"
}
事象
$ 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>]...

原因 : composer自体が古い

対応 : composer自体をアップデートする

対応
# 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.3

# バージョン確認
$ composer --version
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): Downloading (100%)         
  - Installing sebastian/resource-operations (dev-master 4d7a795): Cloning 4d7a795d35 from cache
  - Installing sebastian/object-reflector (dev-master 7707193): Cloning 7707193304 from cache
  - Installing sebastian/recursion-context (dev-master dbe1869): Cloning dbe1869c13 from cache
  - Installing sebastian/object-enumerator (dev-master e6be0a5): Cloning e6be0a5481 from cache
  - Installing sebastian/global-state (2.0.0): Downloading (100%)         
  - Installing sebastian/exporter (dev-master c8c4f19): Cloning c8c4f196e3 from cache
  - Installing sebastian/environment (dev-master 585fbcd): Cloning 585fbcdeff from cache
  - Installing sebastian/diff (dev-master 6906fbe): Cloning 6906fbe334 from cache
  - Installing sebastian/comparator (dev-master 33825cd): Cloning 33825cd25f from cache
  - Installing phpunit/php-timer (dev-master 9ef9968): Cloning 9ef9968ba2 from cache
  - Installing phpunit/php-text-template (1.2.1): Downloading (100%)         
  - Installing phpunit/php-file-iterator (dev-master 2da97ea): Cloning 2da97ea973 from cache
  - Installing theseer/tokenizer (1.1.0): Downloading (100%)         
  - Installing sebastian/code-unit-reverse-lookup (dev-master 22f5f5f): Cloning 22f5f5ff89 from cache
  - Installing phpunit/php-token-stream (dev-master 6df086c): Cloning 6df086c042 from cache
  - Installing phpunit/php-code-coverage (dev-master afe4b8a): Cloning afe4b8aa75 from cache
  - Installing doctrine/instantiator (dev-master 8c8c1af): Cloning 8c8c1afee0 from cache
  - Installing symfony/polyfill-ctype (v1.10.0): Downloading (100%)         
  - Installing webmozart/assert (1.4.0): Downloading (100%)         
  - Installing phpdocumentor/reflection-common (1.0.1): Downloading (100%)         
  - Installing phpdocumentor/type-resolver (0.4.0): Downloading (100%)         
  - Installing phpdocumentor/reflection-docblock (4.3.0): Downloading (100%)         
  - Installing phpspec/prophecy (dev-master 7e27218): Cloning 7e27218052 from cache
  - Installing phar-io/version (2.0.1): Downloading (100%)         
  - Installing phar-io/manifest (dev-master 7761fca): Cloning 7761fcacf0 from cache
  - Installing myclabs/deep-copy (1.x-dev 3e01bda): Cloning 3e01bdad3e from cache
  - Installing phpunit/phpunit (7.5.2): Downloading (100%)         
sebastian/global-state suggests installing ext-uopz (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.6.1)
phpunit/phpunit suggests installing phpunit/php-invoker (^2.0)
phpunit/phpunit suggests installing ext-xdebug (*)
Writing lock file
Generating autoload files
1
1
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
1
1