Command failed with exit code 255: composer serve

Command failed with exit code 255: composer serve

Composer\Config::disableProcessTimeout
php artisan serve
PHP Fatal error: Uncaught Error: Class “Illuminate\Foundation\Application” not found in C:\Users\admin\progressive\web\bootstrap\app.php:14
Stack trace:
#0 C:\Users\admin\progressive\web\artisan(20): require_once()
#1 {main}
thrown in C:\Users\admin\progressive\web\bootstrap\app.php on line 14
Script php artisan serve handling the serve event returned with error code 255

Fatal error: Uncaught Error: Class “Illuminate\Foundation\Application” not found in C:\Users\admin\progressive\web\bootstrap\app.php:14
Stack trace:
#0 C:\Users\admin\progressive\web\artisan(20): require_once()
#1 {main}
thrown in C:\Users\admin\progressive\web\bootstrap\app.php on line 14

please install php 8.2

Run composer install on web folder. and go back on root folder and run npm run build on web folder.

composer install
npm run build

Did not get the solution, please provide the proper Solution for it.

I also installed PHP 8.2 and Composer.

It works for me!