gpt4 book ai didi

laravel-5 - 为什么运行 composer install --no-dev 时出现 Barryvdh\Debugbar\ServiceProvider 错误?

转载 作者:行者123 更新时间:2023-12-05 05:11:56 25 4
gpt4 key购买 nike

我在实时服务器上安装我的 laravel 5.7 应用程序(生产)并且没有开发工具命令我得到错误:

composer install --no-dev
...

- Removing barryvdh/laravel-debugbar (v3.2.1)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover

在 ProviderRepository.php 第 208 行:

  Class 'Barryvdh\Debugbar\ServiceProvider' not found  



Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

在我的 composer.json 中,我在 dev block 下有 barryvdh/laravel-debugbar:

{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
...
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"orangehill/iseed": "^2.6",
"phpunit/phpunit": "^7.0",
"xethron/migrations-generator": "^2.0"
},

在我的 config/app.php 中我有:

'providers' => [
...
Barryvdh\Debugbar\ServiceProvider::class,
'aliases' => [
...
'Debugbar' => Barryvdh\Debugbar\Facade::class,

为什么会出现此错误以及如何解决?

谢谢!

最佳答案

运行前

composer install --no-dev

1) 如上所述清除 bootstrap/cache 子目录2) 删除/vendor/目录(如果有)3) 从 config/app.php 中删除所有行:

Barryvdh\Debugbar

关于laravel-5 - 为什么运行 composer install --no-dev 时出现 Barryvdh\Debugbar\ServiceProvider 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54960146/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com