我是Laravel Framework的新手,我正在尝试从Github克隆一个项目后安装一个Laravel项目。我按照this post中提到的所有步骤进行了操作,但无法安装项目。
每次都在“作曲家安装”步骤中卡住了。我得到以下错误,这与我做“composer update”时的错误相同:
$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 4 installs, 8 updates, 0 removals
- Updating symfony/polyfill-mbstring (v1.3.0 => v1.4.0): Loading from cache
- Updating monolog/monolog (1.22.1 => 1.23.0): Loading from cache
- Updating nikic/php-parser (v3.0.5 => v3.0.6): Loading from cache
- Updating psy/psysh (v0.8.6 => v0.8.9): Loading from cache
- Updating symfony/polyfill-util (v1.3.0 => v1.4.0): Loading from cache
- Updating symfony/polyfill-php56 (v1.3.0 => v1.4.0): Loading from cache
- Updating symfony/event-dispatcher (v3.3.0 => v3.3.4): Loading from cache
- Updating guzzlehttp/guzzle (6.2.3 => 6.3.0): Loading from cache
- Installing composer/ca-bundle (1.0.7): Loading from cache
- Installing bugsnag/bugsnag (v3.5.1): Loading from cache
- Installing bugsnag/bugsnag-psr-logger (v1.1.0): Loading from cache
- Installing bugsnag/bugsnag-laravel (v2.6.0): Loading from cache
Writing lock file
Generating autoload files
Illuminate\Foundation\ComposerScripts::postUpdate
php artisan optimize
Script php artisan optimize handling the post-update-cmd event returned with error code 255
我不知道它做了什么但是根据其他帖子的一些建议,我还尝试了“composer update”和“composer update”,然后是“composer dumpautoload”。我不知道它有什么问题,但似乎没有什么工作。我到处搜索了几个小时但找不到任何解决方案。任何人,请帮忙。
这是我的composer.json文件:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=5.6.4",
"laravel/framework": "5.3.*",
"intervention/image": "2.3.11",
"froala/wysiwyg-editor-php-sdk" : "*",
"chencha/share" : "^5.2",
"laravel/socialite": "^2.0",
"bugsnag/bugsnag-laravel": "^2.0"
},
"require-dev": {
"fzaninotto/faker": "~1.4",
"mockery/mockery": "0.9.*",
"symfony/css-selector": "3.1.*",
"symfony/dom-crawler": "3.1.*"
},
"autoload": {
"classmap": [
"database"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"classmap": [
"tests/TestCase.php"
]
},
"scripts": {
"post-root-package-install": [
"php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"php artisan key:generate"
],
"post-install-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postInstall",
"php artisan optimize"
],
"post-update-cmd": [
"Illuminate\\Foundation\\ComposerScripts::postUpdate",
"php artisan optimize"
]
},
"config": {
"preferred-install": "dist"
}
}
答案 0 :(得分:0)
从services.json
文件夹中删除bootstrap/cache
文件,然后运行
composer dump-autoload -o