Composer/Laravel致命错误



我将这个添加到我的作曲器中。json文件

"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\": "app/",
        "Claremontdesign\Cdbase\": "packages/Claremontdesign/cdbase/src",
        "Claremontdesign\Narbase\": "packages/Claremontdesign/narbase/src",
        "Claremontdesign\Nhr\": "packages/Claremontdesign/nhr/src"
    },
   "files": [
        "packages/Claremontdesign/cdbase/src/Helpers/helpers.php",
        "packages/Claremontdesign/narbase/src/Helpers/helpers.php",
        "packages/Claremontdesign/nhr/src/Helpers/helpers.php"
    ]
},

然后,我从命令行运行composer update,它给我这个错误:

symfony组件调试异常fatalerroreexception类"ClaremontdesignCdbaseServiceProvider"未找到

还有其他人遇到过这个问题吗?

另外,我在add.php

中添加了一个服务提供商
ClaremontdesignCdbaseServiceProvider::class

你试过只运行composer dump吗?composer update在实际运行之前运行一些脚本—例如php artisan clear-compiled。当artisan运行时,它可能会失败,因为它试图注册尚未自动加载的服务提供商。composer dump只生成自动加载文件,这是您在本例中所需要的。

我想你在每个SRC文件夹后都缺少一个斜杠

"autoload": {
    "classmap": [
        "database"
    ],
    "psr-4": {
        "App\": "app/",
        "Claremontdesign\Cdbase\": "packages/Claremontdesign/cdbase/src/",
        "Claremontdesign\Narbase\": "packages/Claremontdesign/narbase/src/",
        "Claremontdesign\Nhr\": "packages/Claremontdesign/nhr/src/"
    },
   "files": [
        "packages/Claremontdesign/cdbase/src/Helpers/helpers.php",
        "packages/Claremontdesign/narbase/src/Helpers/helpers.php",
        "packages/Claremontdesign/nhr/src/Helpers/helpers.php"
    ]
},

相关内容

  • 没有找到相关文章