`The "no-ansi" option does not exist` exception after upgrading
martylamoureux opened this issue Β· 13 comments
- Installer Version: 4.1.1
Description:
After upgrading my Mac to PHP 8.0.1 (After linking PHP 7.4, I still have the issue by the way), Composer 2.0.8 and Laravel Installer to the latest version, I cannot run the laravel new
command anymore.
I got a The "no-ansi" option does not exist"
.
Here is the full output with verbose enabled :
_ _
| | | |
| | __ _ _ __ __ ___ _____| |
| | / _` | '__/ _` \ \ / / _ \ |
| |___| (_| | | | (_| |\ V / __/ |
|______\__,_|_| \__,_| \_/ \___|_|
In Input.php line 150:
[Symfony\Component\Console\Exception\InvalidArgumentException]
The "no-ansi" option does not exist.
Exception trace:
at /Users/martylamoureux/.composer/vendor/symfony/console/Input/Input.php:150
Symfony\Component\Console\Input\Input->getOption() at /Users/martylamoureux/.composer/vendor/laravel/installer/src/NewCommand.php:239
Laravel\Installer\Console\NewCommand->runCommands() at /Users/martylamoureux/.composer/vendor/laravel/installer/src/NewCommand.php:103
Laravel\Installer\Console\NewCommand->execute() at /Users/martylamoureux/.composer/vendor/symfony/console/Command/Command.php:277
Symfony\Component\Console\Command\Command->run() at /Users/martylamoureux/.composer/vendor/symfony/console/Application.php:974
Symfony\Component\Console\Application->doRunCommand() at /Users/martylamoureux/.composer/vendor/symfony/console/Application.php:291
Symfony\Component\Console\Application->doRun() at /Users/martylamoureux/.composer/vendor/symfony/console/Application.php:167
Symfony\Component\Console\Application->run() at /Users/martylamoureux/.composer/vendor/laravel/installer/bin/laravel:13
new [--dev] [--jet] [--stack [STACK]] [--teams] [--prompt-jetstream] [-f|--force] [--] <name>
Steps To Reproduce:
On my side : upgrade PHP, Composer and Laravel Updater, then the issue came up.
Try running composer global update
.
@driesvints This is happening to me on the latest versions:
β ~ composer --version
Composer version 2.0.11 2021-02-24 14:57:23
β ~ laravel --version
Laravel Installer 4.2.4
β ~ php --version
PHP 7.4.16 (cli) (built: Mar 4 2021 20:52:51) ( NTS )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
with Zend OPcache v7.4.16, Copyright (c), by Zend Technologies
with blackfire v1.49.0~mac-x64-non_zts74, https://blackfire.io, by Blackfire
β ~ laravel new test
_ _
| | | |
| | __ _ _ __ __ ___ _____| |
| | / _` | '__/ _` \ \ / / _ \ |
| |___| (_| | | | (_| |\ V / __/ |
|______\__,_|_| \__,_| \_/ \___|_|
The "no-ansi" option does not exist.
new [--dev] [--git] [--branch BRANCH] [--github [GITHUB]] [--organization ORGANIZATION] [--jet] [--stack [STACK]] [--teams] [--prompt-jetstream] [-f|--force] [--] <name>
Okay, so what else could be the cause? As far as I know, all my packages are up to date.
I found the bug in my case!
There was another global composer dependency which used symfony/console with '5.x-dev' as version.
After updating that dependency and another composer global update
the laravel installer works againl
Yes, that turned out to be my problem too. The installer isn't compatible with symfony/console 5.x-dev
but will still happily accept it as a dependency.
I also encountered this issue, with symfony/console:5.3.0. Downgrading to symfony/console:5.2.8 resolved the issue for me.
composer global require symfony/console:5.2.x
I see that some changes related to the --no-ansi option is being made here, [console] Negatable option are null by default
Hi
Follow this steps
-
composer create-project laravel/laravel name-project
-
cd name-project
Something is wrong with the package laravel installer and the global variables
Regards
downgrading symfony also worked for me.
I also encountered this issue, with symfony/console:5.3.0. Downgrading to symfony/console:5.2.8 resolved the issue for me.
composer global require symfony/console:5.2.x
I see that some changes related to the --no-ansi option is being made here, [console] Negatable option are null by default
I did the same thing as this guy and it worked perfect. Thanks very much to this guy.