我有以下composer.json文件用于我的Laravel 4.2.x项目:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"laravel/framework": "4.2.*",
"cartalyst/sentry": "2.1.*",
"way/generators": "2.*",
"laracasts/flash": "~1.0",
"guzzlehttp/guzzle": "~4.0",
"itsgoingd/clockwork": "1.*",
"barryvdh/laravel-ide-helper": "~1.11@dev",
"intervention/image": "dev-master"
},
"autoload": {
"classmap": [
"app/commands",
"app/controllers",
"app/models",
"app/database/migrations",
"app/database/seeds",
"app/tests/TestCase.php"
],
"files": [
"app/Latheesan/helpers.php"
],
"psr-0": {
"Latheesan": "app/"
}
},
"scripts": {
"post-install-cmd": [
"php artisan clear-compiled",
"php artisan ide-helper:generate",
"php artisan optimize"
],
"post-update-cmd": [
"php artisan clear-compiled",
"php artisan ide-helper:generate",
"php artisan optimize"
],
"post-create-project-cmd": [
"php artisan key:generate"
]
},
"config": {
"preferred-install": "dist"
},
"minimum-stability": "dev"
}
直到今天这一切都很顺利。当我运行composer update命令时,我得到了以下错误:
{"error":{"type":"Symfony\Component\Debug\Exception\FatalErrorException","message":"类"Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider"不是found","file":"C:\wamp\www\projectfolder\vendor\laravel\framework\src\Illuminate\Foundation\ProviderRepository.php","line":157}}脚本php artisan clear编译处理更新后返回的cmd事件错误
看起来导致问题的包是barryvdh/laravel-ide-helper
版本~1.11@dev
在github上的项目主页上,它写道:
对于Laravel 4.x,请检查版本1.8
但这似乎是一个死胡同。
那么,对于这个支持laravel 4.x的包,在composer.json
文件上使用的正确的require行是什么呢?
好的,我有解决方案:(对于Laravel 5,但think也可以在Laravel 4中工作)
- 从require数组中删除关于
"barryvdh/laravel-ide-helper"
的行在composer.json文件上 - 运行下一行:
composer require barryvdh/laravel-ide-helper
您将使用barryvdh/laravel-ide助手扩展的最后版本更新您的laravel项目
(更多信息:https://github.com/barryvdh/laravel-ide-helper)
我试过这些线路:
- "barryvdh/laravel-ide帮助程序":"1.*"
- "barryvdh/laravel-ide助手":"1.*@dev"
- "barryvdh/laravel-ide助手":"1.11.*@dev"
对于laravel 5,我在composer更新中得到了下一个错误:
barryvdh/laravel ide helper v12.1需要phpdocumentor/reflection docblock dev-master#6d705c1a0f9e2a6d73d2e9ec0e538b9dfaf4315f->没有匹配的包建立
我找到了,这是我的composer.json
上需要的行
"barryvdh/laravel-ide-helper": "1.11.*@dev"
packagist.org网站上提到了这一点:https://packagist.org/packages/barryvdh/laravel-ide-helper
在我的案例中,
我的作曲家版本已经过时了,这就是问题所在。我将我的composer更新到了最新的1.7版本,问题就消失了。