telescope: New Installation of Telescope fails
- Telescope Version: 2.1
- Laravel Version: 6.0.3
- PHP Version: 7.3.6
- Database Driver & Version:
Description:
I upgraded my 5.8 project yesterday to 6 yesterday using Laravel Shift. Everything seems to be fine with that. Installing Telescope (previously uninstalled), however, fails at Publishing Telescope Configuration...
Steps To Reproduce:
composer require laravel/telescope
php artisan telescope:install
- Errors with:
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
ErrorException : file_get_contents(/home/vagrant/xxx/app/Providers/TelescopeServiceProvider.php): failed to open stream: No such file or directory
at /home/vagrant/xxx/vendor/laravel/telescope/src/Console/InstallCommand.php:80
76|
77| file_put_contents(app_path('Providers/TelescopeServiceProvider.php'), str_replace(
78| "namespace App\Providers;",
79| "namespace {$namespace}\Providers;",
> 80| file_get_contents(app_path('Providers/TelescopeServiceProvider.php'))
81| ));
82| }
83| }
84|
Exception trace:
1 file_get_contents("/home/vagrant/xxx/app/Providers/TelescopeServiceProvider.php")
/home/vagrant/xxx/vendor/laravel/telescope/src/Console/InstallCommand.php:80
2 Laravel\Telescope\Console\InstallCommand::registerTelescopeServiceProvider()
/home/vagrant/xxx/vendor/laravel/telescope/src/Console/InstallCommand.php:43
App\Providers\TelescopeServiceProvider::class,
gets written into app.php but neither the actual service provider nor the migrations are actually created as files.- Using
php artisan telescope:publish
returns
Publishing complete.
Publishing complete.
(yes, twice like that) but nothing actually changes or gets published.
This is my first time trying to use Telescope and I might be missing something obvious but I’m simply following the instructions and it’s not working, so I’d appreciate any help here.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 18
- Comments: 35 (2 by maintainers)
I was was having the same issue on Laravel Framework 6.5 and PHP 7.2.24. I ended up following some steps that @HPWebdeveloper had done and was able to run the commands.
At this point I noticed the App\Providers\TelescopeServiceProvider.php file was now there as well as App\config\telescope.php however I do not see a migrate file anywhere. But when continuing on.
This actually runs the migration. But I have no idea where it is coming from…
I’m using the exact same as kvn1234. When running the
php artisan telescope:install
it gives mebut it says
nothing to migrate
after going to the next step (runningphp artisan migrate
). Even after removing it etc, I can’t seem to get it to wrok.My solution is here:
https://medium.com/@panjeh/new-installation-of-laravel-telescope-fails-418afa2b8972
Frustrating. I have used this before at the beginning of the year and it was like a 5 minute process to get this thing up and running. Now I am copying files and chasing down errors, and finally got it running after 30 minutes by following steps here:
php artisan telescope:install
and having it fail the first time with an fopen errorphp artisan telescope:install
a second time and it appeared to have worked (no errors)php artisan migrate
and there was nothing to migratephp artisan telescope:publish
and it said it published it twicephp artisan migrate
again and there was nothing to migratevendor/laravel/telescope/stubs/TelescopeServiceProvider.stub
toapp/Providers/TelescopeServiceProvider.php
vendor/laravel/telescope/config/telescope.php
toconfig/telescope.php
vendor/laravel/telescope/src/Storage/migrations/2018_08_08_100000_create_telescope_entries_table.php
todatabase/migrations/2018_08_08_100000_create_telescope_entries_table.php
config/app.php
and moving the registration toapp/Providers/AppServiceProvider.php
from the docsphp artisan migrate
php artisan vendor:publish --tag=telescope-assets --force
I am not sure if any of steps 1-4 actually did anything since I copied most everything over on my own.
I got it working by manually copying the
TelescopeServiceProvider
file to theProviders
directory:cp vendor/laravel/telescope/stubs/TelescopeServiceProvider.stub app/Providers/TelescopeServiceProvider.php
I also added the
TELESCOPE_ENABLED=true
line to the.env
file, just in case.I am able to install Telescope correctly on a fresh Laravel 6 application.
I fixed this issue like this 1 . Running these commands
php artisan cache:clear and php artisan config:clear
2.Then Later Require Telescopecomposer require laravel/telescope
3.Then Later I run this commandphp artisan telescope:install
So Basically It WORKED
if you want to remove the package you installed
Run remove command
composer remove laravel/telescope
then comment or remove the App\Providers\TelescopeServiceProvider::class, In app/Config FolderThis problem is still persisting and I don’t know why it is ignored. It exists. Installation is failing.
Thanks for the support. It worked after running php artisan cache:clear & php artisan config:clear commands.
ty @pszucs 👍
TELESCOPE_ENABLED=true
worked for me.Ran into this issue as well. Clearing caches, then removing line
App\Providers\TelescopeServiceProvider::class,
from app/config/app.php as others recommended worked because the install command won’t run if that line already exists in the file.The Cause: For myself the cause was I still had the following in my composer.json:
This was removed from composer.json in 2017: https://github.com/laravel/laravel/commit/2f4d72699cdc9b7db953055287697a60b6d8b294
I encountered a similar issue, I emptied the bootstrap/cache directory and I re-ran all installation steps. It solved my problem.
Thanks @alecjamesgarcia. This worked for me. Regarding the migration, it comes from the newly added telescope module in the laravel package within vendor.
Hello,
same problem here, i had to copy manually the provider from stubs, and the migration from src/Storage/migrations.
A this point an error of mix manifest occured, and i had to do :
php artisan vendor:publish --tag=telescope-assets --force
and now telescope is working, after doing
npm run prod