在 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.。如图12、发现应用程序的 config/app.php 配置文件中 TelescopeServiceProvider 服务提供者注册 已经删除。先再次添加回去。如图23、再次运行:php artisan telescope:install。不再报错。如图34、还原第 2 步骤的操作,在 App\Providers\AppServiceProvider 类的 register 方法中,手动注册 telescope 的服务提供者
PS E:\wwwroot\erp-backend> php artisan telescope:install
ERROR There are no commands defined in the "telescope" namespace.
PS E:\wwwroot\erp-backend> php artisan telescope:install
Publishing Telescope Service Provider...
Publishing Telescope Assets...
Publishing Telescope Configuration...
Telescope scaffolding installed successfully.
/**
* 注册应用服务
*
* @return void
*/
public function register()
{
if ($this->app->environment('local')) {
$this->app->register(\Laravel\Telescope\TelescopeServiceProvider::class);
$this->app->register(TelescopeServiceProvider::class);
}
}


