简体   繁体   中英

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?

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.

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.

use composer dump-autoload

and:

artisan cache:clear

but

install composer require brick/math

its work

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM