Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel Telescope Failed to open stream: no such file or directory TelescopeServiceProvider.php

I am trying to use the Telescope package from Laravels official documentation and I followed the first 2 steps:

composer require laravel/telescope

and

php artisan telescope:install

Everything went fine in my command line untill the install. I got the error:

ErrorException : file_get_contents(path\app\Providers/TelescopeServiceProvider.php: failed to open stream: No such file or directory at: vendor\laravel\telescope\src\Console\InstallCommand.php

So, of course, I googled the issue and found this and I checked to see if my provider's folder exists. It does and indeed the TelescopeServiceProvider.php is not there. I tried to run the command php artisan telescope:install again and it provided me the message:

Telescope scaffolding installed successfully.

which I thought was strange but ok, I went to the next step of the documentation:

  • After installing the Telescope, you should also run the migrate command: php artisan migrate

So I ran that command and I got the message:

Nothing to migrate.

So obviously this didn't go right. I checked after the "fake" installed successfully message if the TelescopeServiceProvider exists now but it still didn't.

What did I do wrong and how do I fix this issue?

like image 808
Loko Avatar asked Sep 25 '19 12:09

Loko


1 Answers

Try update Telescope,

composer update --prefer-source

Try removing Telescope and then reinstalling the package as the installation seems to have broken the package:

composer remove laravel/telescope
composer require laravel/telescope

Try:

composer dump-autoload

or:

artisan cache:clear

after you update or make changes to composer.json to refresh everything.

like image 138
Script47 Avatar answered Sep 20 '22 18:09

Script47