laravel-5 - Why running composer install --no-dev I got error with Barryvdh\Debugbar\ServiceProvider?
问题描述
I install my laravel 5.7 app (production) at live server and with no dev tools command command I got error:
composer install --no-dev
...
- Removing barryvdh/laravel-debugbar (v3.2.1)
Generating optimized autoload files
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover
In ProviderRepository.php line 208:
Class 'Barryvdh\Debugbar\ServiceProvider' not found
Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1
In my composer.json I have barryvdh/laravel-debugbar under dev block:
{
"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"
},
In my config/app.php I have :
'providers' => [
...
Barryvdh\Debugbar\ServiceProvider::class,
'aliases' => [
...
'Debugbar' => Barryvdh\Debugbar\Facade::class,
Why this error and how to fix it?
Thanks!
解决方案
Before running
composer install --no-dev
1) Clear bootstrap/cache subdirectory as mentioned above 2) remove /vendor/ directory if you have it 3) Remove from config/app.php ll lines with :
Barryvdh\Debugbar
推荐阅读
- java - 如何仅在 . 如果它前面有双斜杠而不是?
- html - 我想使用 express js 将数据插入 mysql 数据库,但我无法将其插入以及将数据获取到终端
- html - 怎么做x 倍大?但不是线性变大,它必须停止
- react-native - react-native-iap getProducts 返回空数组
- python - 如何使用python删除redis中一个键的部分数据?
- flutter - 如何使用密钥从 Firestore 加载数据
- python - 即使我插入正确的值,Python While 也会继续循环
- php - 使用 laravel 向客户发送自定义电子邮件
- sql - 将 JSON 数组与另一个表连接
- javascript - 数据未在带有 ajax 的模式窗口中动态显示