Composer安装 - 找不到类'Acme \ BackendServiceProvider'

时间:2015-11-17 17:40:49

标签: laravel laravel-4

尝试安装Laravel 4.2项目失败,输出如下:

user@machine /project $ composer update
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> php artisan clear-compiled
PHP Fatal error:  Class 'Acme\Modules\Account\AccountServiceProvider' not found in /project/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 157
{"error":{"type":"Symfony\\Component\\Debug\\Exception\\FatalErrorException","message":"Class 'Acme\\Modules\\Account\\AccountServiceProvider' not found","file":"\/project\/vendor\/laravel\/framework\/src\/Illuminate\/Foundation\/ProviderRepository.php","line":157}}Script php artisan clear-compiled handling the post-install-cmd event returned with an error



  [RuntimeException]                                                                                                                                                                                           
  Error Output: PHP Fatal error:  Class 'Acme\Modules\Account\AccountServiceProvider' not found in /project/vendor/laravel/framework/src/Illuminate/Foundation/ProviderRepository.php on line 15  
  7                                                                                                                                                                                                            

以下似乎是app/config/app.php

失败的提供商
'Acme\BackendServiceProvider',
'Acme\Modules\Authentication\AuthenticationServiceProvider',
'Acme\Modules\Account\AccountServiceProvider',
'Acme\Modules\Payment\PaymentServiceProvider',
'Acme\Modules\MerchantAccount\MerchantAccountServiceProvider',

这是composer.json的自动加载部分:

"autoload": {
    "classmap": [
        "app/commands",
        "app/controllers",
        "app/models",
        "app/database/migrations",
        "app/database/seeds",
        "app/tests/TestCase.php"
    ],
    "files": [
        "app/Acme/helpers.php"
    ],
    "psr-4": {
        "Acme\\": "app/Acme"
    }
},        

知道这个错误意味着什么以及如何解决它?

1 个答案:

答案 0 :(得分:0)

这是a known issue

您必须手动删除compiled.php文件:

rm bootstrap/compiled.php

在此之后,您应该能够正确运行composer update