Skip to content
Advertisement

Failed to install laravel/jetstream on laravel 8

after the installation of jetstream via composer composer require laravel/jetstream then suddenly get an ErrorException that there’s no such file or directory.

Writing lock file
Generating optimized autoload files
> IlluminateFoundationComposerScripts::postAutoloadDump
> @php artisan package:discover --ansi

   ErrorException

  require(F:laravelAppstest_projvendorlaraveljetstreamsrc/../routes/.php): failed to open stream: No such file or directory

  at F:laravelAppstest_projvendorlaravelframeworksrcIlluminateSupportServiceProvider.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▕     /**

  1   F:laravelAppstest_projvendorlaravelframeworksrcIlluminateSupportServiceProvider.php:144
      require()

  2   F:laravelAppstest_projvendorlaraveljetstreamsrcJetstreamServiceProvider.php:172
      IlluminateSupportServiceProvider::loadRoutesFrom("F:laravelAppstest_projvendorlaraveljetstreamsrc/../routes/.php")
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.

I use this guideline for the installation. https://jetstream.laravel.com/1.x/installation.html

I tried to delete the vendor and run composer update doesn’t work tried to cache clear but still doesn’t work.

Advertisement

Answer

Uncache your routes and try again.


  1. Remove jetstream from composer

    composer remove laravel/jetstream
    
  2. Then you should be able to cache your routes using

     php artisan route:cache
    
  3. Then install jetstream

     composer require laravel/jetstream
    
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement