I have 2 PHP versions on my PC. In the past I was using PHP 8 (8.1.13) like this to install laravel:
C:\PHP8\php8.exe C:\composer\composer.phar create-project laravel/laravel Project-Name
It was working for 2 projects, which I installed a few months ago. Today I try to create a new laravel project, but it tells me I need to upgrade my composer:
Problem 1
- laravel/framework[v10.0.0, ..., v10.3.1] require composer-runtime-api ^2.2 -> found composer-runtime-api[2.0.0] but it does not match the constraint.
- Root composer.json requires laravel/framework ^10.0 -> satisfiable by laravel/framework[v10.0.0, ..., v10.3.1].
The most recent version for laravel is now 10 and it seems it needs a higher version of composer. Now I dont want to upgrade composer itself because I am not sure how this will affect the other projects, or is it safe to do so?
My solution was to install the same laravel version, which I used in the other projects, so I did this:
C:\PHP8\php8.exe C:\composer\composer.phar create-project --prefer-dist laravel/laravel:^7.29 Project-Name
This for some reason gives me this error:
package:discover --ansi handling the post-autoload-dump event returned with error code 255
I tried now all solutions, which I found online, but nothing works, any idea?
UPDATE:
Setting up now everything fresh in a venv via phpStorm. I use now the newest version of composer and my PHP8 installation. This leads to the same error:
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255