I got this error while deploying my project on AWS Elastic BeanStalk. I recently pulled my project from github, before that it deploys without issues.
On tracing the error, I found that this line @php artisan package:discover --ansi
is where the issue is coming from.
Below is the error:
Generating optimized autoload files
Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi PHP Parse error: syntax error, unexpected identifier "AnsiColorMode" in /codebuild/output/src155211532/src/vendor/symfony/console/Output/AnsiColorMode.php on line 20 Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
This works well on Docker if I delete the composer.lock
file and run the command sail composer install
.
Please, any help is appreciated.