]: Class Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script
When it tries to run "composer dump-autoload --optimize" or any "php artisan..." I get the error
Generating optimized autoload files
Class Illuminate\Foundation\ComposerScripts is not autoloadable, can not call post-autoload-dump script
> @php artisan package:discover --ansi
PHP Fatal error: Uncaught Error: Class 'Illuminate\Foundation\Application' not found in /var/www/crechedigital.com/pre-prod/releases/release_20200403135242/bootstrap/app.php:14
Stack trace:
#0 /var/www/crechedigital.com/pre-prod/releases/release_20200403135242/artisan(20): require_once()
#1 {main}
thrown in /var/www/crechedigital.com/pre-prod/releases/release_20200403135242/bootstrap/app.php on line 14
Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 255
If I execute a "composer update" before on the server, it works. But I dont think it is the recommended approach. Have you already faced this or know how can I resolve?
Thanks in advance, cheers from Brazil.
have you ever tried to update your global composer component by:
or try to
not composer update