Symfony 包错误 NotFoundException:尝试从命名空间 "Toiba\FullCalendarBundle" 加载 class "FullCalendarBundle"

Symfony bundle error NotFoundException: Attempted to load class "FullCalendarBundle" from namespace "Toiba\FullCalendarBundle"

我在 php 7+ 和 symfony 3.4 中编写了一个 webapp,在开发模式下一切正常。

然后我尝试了这个命令:

composer install --no-dev

并且发生了这个错误:

[RuntimeException] An error occurred when executing the ""cache:clear --no-warmup"" command:

Fatal error: Uncaught Symfony\Component\Debug\Exception\ClassNotFoundException: Attempted to load class "FullCalendarBundle" from namespace "Toiba\FullCalendarBundle". Did you forget a "use" statement for another namespace? in F:\wamp64\www\justdrive\app\AppKernel.php:15

我试过修改这个:

"psr-4": {
    "AppBundle\": "src/AppBundle"
},

对此:

"psr-4": {
    "": "src/"
},

然后执行这个命令:

composer dump-autoload

但是在我提到的第一个命令之后我仍然得到同样的错误。

这是我的 composer .lock 中的包

{
            "name": "toiba/fullcalendar-bundle",
            "version": "v6.2.4",
            "source": {
                "type": "git",
                "url": "https://github.com/toiba/FullCalendarBundle.git",
                "reference": "d8b22cc3a159819fa2a4bbd1c7aad026c6bbad74"
            },
            "dist": {
                "type": "zip",
                "url": "https://api.github.com/repos/toiba/FullCalendarBundle/zipball/d8b22cc3a159819fa2a4bbd1c7aad026c6bbad74",
                "reference": "d8b22cc3a159819fa2a4bbd1c7aad026c6bbad74",
                "shasum": ""
            },
            "require": {
                "php": "^5.5|^7.0",
                "symfony/framework-bundle": "^3.4|^4.0"
            },
            "require-dev": {
                "phpspec/phpspec": "^2.5"
            },
            "type": "symfony-bundle",
            "autoload": {
                "psr-4": {
                    "Toiba\FullCalendarBundle\": ""
                }
            },
            "notification-url": "https://packagist.org/downloads/",
            "license": [
                "MIT"
            ],
            "authors": [
                {
                    "name": "Rebeca Mora Anca",
                    "email": "anca.rebeca@gmail.com",
                    "role": "Developer"
                },
                {
                    "name": "Théo Attali",
                    "email": "theoattali@gmail.com",
                    "role": "Developer"
                }
            ],
            "description": "Symfony integration of FullCalendar.js library. Events can be stored with Doctrine, MongoDB, CouchDB and others",
            "homepage": "https://github.com/toiba/FullCalendarBundle",
            "keywords": [
                "calendar",
                "fullcalendar",
                "jquery calendar",
                "symfony calendar"
            ],
            "abandoned": "https://github.com/tattali/CalendarBundle",
            "time": "2018-08-09T18:06:32+00:00"
        }

这是 appkernel.php

中的捆绑包
public function registerBundles()
    {
        $bundles = [
...
new Toiba\FullCalendarBundle\FullCalendarBundle(),
...
];

你能帮帮我吗?

多亏了@Cerad 和@Frankich,我才让它工作。

我必须执行

composer require toiba/fullcalendar-bundle

正确安装,然后

composer install --no-dev

命令唤醒很好!

非常感谢。