31

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.

Yeasir Arafat
  • 1,425
  • 1
  • 13
  • 28

3 Answers3

72

To solve the problem, I had to update the composer by running the commands-

composer clearcache

composer selfupdate

Yeasir Arafat
  • 1,425
  • 1
  • 13
  • 28
8

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

dipenparmar12
  • 3,042
  • 1
  • 29
  • 39
Ariful Islam
  • 696
  • 6
  • 11
2

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.

GotaloveCode
  • 994
  • 1
  • 13
  • 30