When trying to install laravel 10, I am getting this error-
laravel/framework[v10.0.0, ..., v10.0.3] require composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint.
When trying to install laravel 10, I am getting this error-
laravel/framework[v10.0.0, ..., v10.0.3] require composer-runtime-api ^2.2 -> found composer-runtime-api[2.1.0] but it does not match the constraint.
To solve the problem, I had to update the composer by running the commands-
composer clearcache
composer selfupdate
To resolve this problem, you can simply update your composer by running the following command:
composer self-update
After updating, try again and this should resolve your issue
Use sudo composer self-update
For some reason composer -v was showing 2.5.8 so composer self-update was by itself not updating the global version. Using sudo updated the 'hidden' version that was using the older runtime.