Laravel Nova 安装 - "nova" 命名空间中没有定义任何命令

Laravel Nova installation - There are no commands defined in the "nova" namespace

我正尝试在 Laravel 5.8 项目中 install Laravel Nova according to the docs。按照指示,我将其添加到我的 composer.json 文件中:

"repositories": [
    {
        "type": "composer",
        "url": "https://nova.laravel.com"
    }
],

并且在 require 部分:

"laravel/nova": "~2.0",

然后我 运行 composer update(并提供了我的 ID 和密码),它成功安装了 nova 包,我可以在我的 composer.lock 文件中看到它们。

下一步应该是 php artisan nova:install,但是,这给了我:

There are no commands defined in the "nova" namespace.

这种事情通常由 composer dumpautoloadphp artisan config:clear 修复,但是,两者都没有帮助。我尝试使用 zip 下载和 path 类型的 repo 配置,效果相同。我也试过更暴力的php artisan config:cache,但也没用。

我错过了什么?

在继续 Laravel Nova 安装之前使用 composer dump-autoload。 到时候就好了。

尝试运行php artisan clear-compiled

The clear-compiled command is used to clear the compiled classes and services application cache. These two files are located in the bootstrap/cache/ directory. The compiled classes cache is stored in a file named compiled.php and the services cache is stored in a file named services.php. This command will remove both of these files if they exist.

Source