Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Antonella's avatar

ErrorException

when I launch the composer install it gives me this error can you help me

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi

ErrorException

require(/home/forge/stage.it/vendor/laravel/jetstream/src/../routes/.php): failed to open stream: No such file or directory

at vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:144 140▕ / 141▕ protected function loadRoutesFrom($path) 142▕ { 143▕ if (! ($this->app instanceof CachesRoutes && $this->app->routesAreCached())) { ➜ 144▕ require $path; 145▕ } 146▕ } 147▕ 148▕ /*

  +14 vendor frames 

15 [internal]:0 Illuminate\Foundation\Application::Illuminate\Foundation{closure}()

  +5 vendor frames 

21 artisan:37 Illuminate\Foundation\Console\Kernel::handle()

0 likes
4 replies
Sinnbeck's avatar

Can you dump autoload ?

composer dump-autoload
Antonella's avatar

give me error :

Illuminate\Foundation\ComposerScripts::postAutoloadDump @php artisan package:discover --ansi

ErrorException

require(/home/forge/stage.it/vendor/laravel/jetstream/src/../routes/.php): failed to open stream: No such file or directory

at vendor/laravel/framework/src/Illuminate/Support/ServiceProvider.php:144 140▕ / 141▕ protected function loadRoutesFrom($path) 142▕ { 143▕ if (! ($this->app instanceof CachesRoutes && $this->app->routesAreCached())) { ➜ 144▕ require $path; 145▕ } 146▕ } 147▕ 148▕ /*

  +14 vendor frames 

15 [internal]:0 Illuminate\Foundation\Application::Illuminate\Foundation{closure}()

  +5 vendor frames 

21 artisan:37 Illuminate\Foundation\Console\Kernel::handle() Script @php artisan package:discover --ansi handling the post-autoload-dump event returned with error code 1

I tried with the following commands: rm -r vendor/ composer install composer dump-autoload

but I always get that error

Sinnbeck's avatar

Try adding this to you composer.json file, run install, and remove it again

"extra": {
    "laravel": {
        "dont-discover": [
            "laravel/jetstream"
        ]
    }
},
1 like
Antonella's avatar

it happens every time I do a pull from git. very often I solve by deleting the vendor folder and giving composer install. I solved by deleting everything and re-installing. @sinnbeck

Please or to participate in this conversation.