简体   繁体   English

Laravel 望远镜无法打开 stream:没有这样的文件或目录 TelescopeServiceProvider.php

[英]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:我正在尝试使用 Laravel 官方文档中的 Telescope package ,我遵循了前两个步骤:

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 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.它确实存在,而且TelescopeServiceProvider.php确实不存在。 I tried to run the command php artisan telescope:install again and it provided me the message:我尝试再次运行命令php artisan telescope:install并为我提供了以下消息:

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安装 Telescope 后,您还应该运行migrate命令: php artisan migrate

So I ran that command and I got the message:所以我运行了那个命令,我得到了消息:

Nothing to migrate.没有什么可以迁移的。

So obviously this didn't go right.所以显然这不是 go 正确的。 I checked after the "fake" installed successfully message if the TelescopeServiceProvider exists now but it still didn't.如果 TelescopeServiceProvider 现在存在,我在“假”安装成功消息后检查了它,但它仍然不存在。

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:尝试移除 Telescope,然后重新安装 package,因为安装似乎破坏了 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.在您更新或更改composer.json以刷新所有内容后。

Per the Telescope Github Issues根据望远镜 Github 问题

Telescope is not ready for Laravel 6 yet.望远镜还没有为 Laravel 6 做好准备。 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这是工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Laravel 5.7 php getimageinfo'无法打开流:没有这样的文件或目录' - Laravel 5.7 php getimageinfo 'failed to open stream: No such file or directory' Laravel classloader.php 错误无法打开流:没有这样的文件或目录 - Laravel classloader.php error failed to open stream: No such file or directory Laravel imagecreatefromjpeg():无法打开 stream:没有这样的文件或目录 - Laravel imagecreatefromjpeg(): failed to open stream: No such file or directory php无法打开流 - 没有这样的文件或目录 - php failed to open stream - no such file or directory 无法打开流:在…中没有这样的文件或目录? 特定于PHP - Failed to open stream: No such file or directory in…? PHP Specific PHP-无法打开流:没有这样的文件或目录 - PHP - Failed to open stream: No such file or directory 无法打开流:PHP中没有此类文件或目录 - failed to open stream: No such file or directory in PHP PHP-无法打开流:中没有此类文件或目录 - PHP - failed to open stream: No such file or directory in 无法打开流:PHP fopen中没有目录的此类文件 - Failed to open stream: No such file of directory in… PHP fopen PHP / SQL-无法打开流:没有这样的文件或目录 - PHP/SQL - failed to open stream: No such file or directory
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM