9

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?

Community
  • 1
  • 1
Loko
  • 6,539
  • 14
  • 50
  • 78
  • I think that the telescope installation failed and for some reason (maybe permissions?) Laravel couldn't create the `TelescopeServiceProvider` class in your app/Providers folder... Remove the package, run a `composer update` and run the process again (require -> install)... If after the `php artisan telescope:install` you don't see the provider class, the assets inside public folder and the config file than there's a problem with filesystem permission IMHO – IlGala Sep 25 '19 at 12:32
  • You can try to download the missing service provider from github, add it to the Providers directory manually and then run `telescope:install`. – Bram Verstraten Sep 25 '19 at 13:33
  • https://github.com/laravel/telescope/issues/732#issuecomment-542988625 Other people addressing the issue – Loko Oct 18 '19 at 06:40

3 Answers3

5

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.

Script47
  • 14,230
  • 4
  • 45
  • 66
  • This still doesn't do anything for me. I still have nothing to migrate after installing telescope. It seems as if the install went wrong but it still proceeded. – Loko Sep 25 '19 at 12:24
  • @Loko what if you fire `composer update --prefer-source`? – Script47 Sep 25 '19 at 12:25
  • @Loko OK. So remove Telescope: `composer remove laravel/telescope` and then reinstall it: `composer require laravel/telescope`. Make sure you have the correct permissions to modify the files. – Script47 Sep 25 '19 at 12:28
  • Nope. I reinstalled it, but it's still giving me the `nothing to migrate` message – Loko Sep 25 '19 at 12:33
  • This time there weren't any errors no. It really seems as if the first time messed everything up. – Loko Sep 25 '19 at 12:34
  • Then I'd suggest removing `vendor` and reinstalling all the packages. But, make a backup, just in case. – Script47 Sep 25 '19 at 12:36
  • Please verify if there is a telescope record in your migrations table? If so, remove it before reinstalling. – Bram Verstraten Sep 25 '19 at 12:38
  • @BramVerstraten There is no telescope record in my migrations table. – Loko Sep 25 '19 at 12:40
  • @Loko your migrations might be out of sync, copy your db, then run `php artisan migrate:fresh`. – Script47 Sep 25 '19 at 12:41
  • Thats not the issue though since there is not even a migration after the telescope install when there is supposed to be something to migrate as the documentation states. – Loko Sep 25 '19 at 12:49
  • Please verify your composer phar with `composer diagnose`. Update when needed with `composer self-update`. – Bram Verstraten Sep 25 '19 at 13:00
  • @BramVerstraten `composer diagnose` gives me all **OK**. Nothing wrong there – Loko Sep 25 '19 at 13:10
  • Hello the composer dump-auto will fix the problem right now. – Jud3v Aug 07 '20 at 13:28
1

Per the Telescope Github Issues

Telescope is not ready for Laravel 6 yet. Many people are having this same issue. The solution is to look at this issue. Although it is a workaround, not a solution.

Robert Gaum
  • 129
  • 1
  • 10
0

use composer dump-autoload

and:

artisan cache:clear

but

install composer require brick/math

its work

Netwons
  • 1,170
  • 11
  • 14