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

Antonella's avatar

ErrorException composer update

when I launch the composer-update from staging it gives me this error you know why?

riting lock file Generating optimized autoload files

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

ErrorException

require(/home/forge/hoqustaging.webmapp.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▕ /*

  +15 vendor frames 

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

  +5 vendor frames 

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

0 likes
8 replies
Antonella's avatar

OK I ran the command:

php artisan package:discover --ansi

it gave me the following error which i don't understand how to fix:

 ErrorException 

  require(/home/forge/hoqustaging.webmapp.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▕     /**

      +15 vendor frames 
  16  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()

      +5 vendor frames 
  22  artisan:37
      Illuminate\Foundation\Console\Kernel::handle()

which was essentially what I had put on earlier @sarwarahmed

laracoft's avatar
laracoft
Best Answer
Level 27

@gianmarx

  1. Did you modify your composer.json manually?
  2. Did your composer run successfully?
  3. Try remove vendor folder and run composer update again.
1 like
Antonella's avatar

I removed the vendor folder and ran the composer update command gave me the following error:

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

   ErrorException 

  require(/home/forge/../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▕     /**

      +15 vendor frames 
  16  [internal]:0
      Illuminate\Foundation\Application::Illuminate\Foundation\{closure}()

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

1

@sarwarahmed @laracoft

Antonella's avatar

I solved as follows:

I deleted the vendor folder with:

rm -r vendor/

Re-run:

composer install 

and then

composer dump-autoload 

and it's back to work

many thanks @laracoft

Please or to participate in this conversation.