没有不值得去解决的问题,也没有不值得去学习的技术!

在 Laravel 9 中,执行:php artisan telescope:install 时报错:ERROR There are no commands defined in the “telescope” namespace.

在 Laravel 9 中,执行:php artisan telescope:install 时报错:ERROR There are no commands defined in the "telescope" namespace.
1、在 Laravel 9 中,执行:php artisan telescope:install 时报错:ERROR There are no commands defined in the “telescope” namespace.。如图1
在 Laravel 9 中,执行:php artisan telescope:install 时报错:ERROR There are no commands defined in the "telescope" namespace.
图1


PS E:\wwwroot\erp-backend> php artisan telescope:install

   ERROR  There are no commands defined in the "telescope" namespace.



2、发现应用程序的 config/app.php 配置文件中 TelescopeServiceProvider 服务提供者注册 已经删除。先再次添加回去。如图2
发现应用程序的 config/app.php 配置文件中 TelescopeServiceProvider 服务提供者注册 已经删除。先再次添加回去
图2
3、再次运行:php artisan telescope:install。不再报错。如图3
再次运行:php artisan telescope:install。不再报错
图3


PS E:\wwwroot\erp-backend> php artisan telescope:install
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.


4、还原第 2 步骤的操作,在 App\Providers\AppServiceProvider 类的 register 方法中,手动注册 telescope 的服务提供者


/**
 * 注册应用服务
 *
 * @return void
 */
public function register()
{
    if ($this->app->environment('local')) {
        $this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
        $this->app->register(TelescopeServiceProvider::class);
    }
}


PHP / Laravel / Yii2 老项目维护与长期技术支持

如果你的 PHP / Laravel / Yii2 项目已经上线,但遇到原开发离职、Bug 长期无人修复、接口不稳定、性能下降、代码难以接手等问题,可以联系我做一次远程技术排查。

适合以下情况:
✅ 老旧 PHP 系统无人维护
✅ Laravel / Yii2 项目 Bug 修复
✅ 后台管理系统小功能迭代
✅ RESTful API 接口排查
✅ MySQL / Redis / Nginx 性能问题
✅ 长期远程兼职维护

可先从一次小问题开始:
✅ 线上报错排查
✅ 接口异常分析
✅ 慢查询与性能瓶颈定位
✅ 代码结构初步评估
✅ 部署环境与日志检查

如需咨询,请联系我,并注明:PHP 维护咨询

联系方式:
Telegram:@shuijingwan
微信:13980074657
邮箱:shuijingwanwq@gmail.com

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理