0

I've seen this error "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in multiple questions both here and online-- but every solution simply says to upgrade composer to fix it. I've updated composer, updated laravel installer, and globally updated all packages, yet I still see the error:

➜ laravel -V
Laravel Installer 3.0.1

➜ composer self-update
You are already using composer version 1.10.1 (stable channel).

➜ php -v
PHP 7.3.16 (cli) (built: Mar 19 2020 11:19:09) ( NTS )

➜ composer global update
Changed current directory to ~/.composer
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files

➜ laravel new myprojectname
Crafting application...
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"?

Any other ideas what to check?

This is on Mac OSX Catalina

yivi
  • 42,438
  • 18
  • 116
  • 138
user101289
  • 9,888
  • 15
  • 81
  • 148
  • Does this answer your question? [Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"?](https://stackoverflow.com/questions/54184707/warning-continue-targeting-switch-is-equivalent-to-break-did-you-mean-to-u) – pr1nc3 Feb 11 '20 at 15:51
  • @pr1nc3 no unfortunately all those solutions seem to be "upgrade composer" which I already did. Thanks – user101289 Feb 11 '20 at 16:36
  • 1
    There is something missing here. With PHP 7.3, composer 1.10.1, and Laravel installer 3.0.1 I can't reproduce these results. See it [here](https://imgur.com/a/bF6VORR). Despite what the (wrong) answer below says, you do not need to downgrade to PHP 7.2 to work with the latest version of Laravel and/or composer. As you would imagine, that doesn't make any sense. – yivi Mar 28 '20 at 18:47
  • 1
    You'll need to add more details for anyone to take a guess. But without being able to repro the issue, it's hard. Just to make sure, clear composer cache (`clearcache`). What OS are you on? – yivi Mar 28 '20 at 18:50
  • 1
    Re: your edit. My screenshoot was taken on Mac as well. How are you installing PHP? Homebrew? Something besides the obvious is broken, because what you are doing should work. Cleared composer's cache? – yivi Mar 28 '20 at 23:17
  • @yivi thanks, that `clearcache` idea got me further along to the point that I could see the problem. – user101289 Mar 30 '20 at 15:26

1 Answers1

1

This ended up being a problem with some conflicting aliases in my .zshrc config.

Composer was aliased as usr/local/bin/composer.phar, so I moved that file to ~/.composer/vendor/bin/composer, and deleted all the aliases for laravel, lumen and composer in my .zshrc file and removed and re-added the basic export PATH="$PATH:$HOME/.composer/vendor/bin" path as well.

This was helpful: https://laracasts.com/discuss/channels/general-discussion/sh-composer-command-not-found

user101289
  • 9,888
  • 15
  • 81
  • 148