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

faraz_dev's avatar

Failed to install (via composer) jetstream package on laravel 8

whenever i install jetstream on newly installed laravel 8 i got the following error

@php artisan package:discover --ansi

ErrorException

require(/home/faraz/Desktop/projects/lara8/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

Installation failed, reverting ./composer.json to its original content.

0 likes
6 replies
bobbybouwmann's avatar

Looks like it's downloading something incorrectly. Have you tried deleting your vendor directory and installing the project again?

1 like
faraz_dev's avatar

Could not solve the issue with composer but installing Jetstream with laravel installer works.

thanks @bobbybouwmann

MarkoZz's avatar
MarkoZz
Best Answer
Level 11

I think its probably issue with cached config. Try removing bootstrap/cache/config.php. Jetstream tries to load routes from directory that is defined in Jetstream config.

($this->loadRoutesFrom(__DIR__.'/../routes/'.config('jetstream.stack').'.php');

In your case case config('jetstream.stack') probably returns null.

7 likes
no4ch's avatar

Thanks! After I'm had used -- php artisan route:clear

Please or to participate in this conversation.