我的composer.json
:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.1.3",
"darkaonline/l5-swagger": "5.6.*",
"fideloper/proxy": "~4.0",
"laravel/framework": "5.6.*",
"laravel/passport": "^5.0",
"laravel/tinker": "~1.0",
"predis/predis": "^1.1",
"spatie/laravel-permission": "^2.9"
},
"require-dev": {
"filp/whoops": "~2.0",
"fzaninotto/faker": "~1.4",
"mockery/mockery": "~1.0",
"nunomaduro/collision": "~1.1",
"phpunit/phpunit": "~7.0",
"reliese/laravel": "^0.0.13",
"symfony/thanks": "^1.0",
"xethron/migrations-generator": "^2.0"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": [
]
}
},
"scripts": {
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
composer diagnose
的输出:
Checking composer.json: OK
Checking platform settings: OK
Checking git settings: OK
Checking http connectivity to packagist: OK
Checking https connectivity to packagist: OK
Checking github.com rate limit: OK
Checking disk free space: OK
Checking pubkeys: FAIL
Missing pubkey for tags verification
Missing pubkey for dev verification
Run composer self-update --update-keys to set them up
Checking composer version: OK
Composer version: 1.6.3
PHP version: 7.2.2-3+ubuntu14.04.1+deb.sury.org+1
PHP binary path: /usr/bin/php7.2
当我运行此命令时:
composer update
我得到以下输出:
ATTENTION! Big file ~5k lines, the composer.lock
https://pastebin.com/1Jc1HqRj
我预计会发生这种情况: predis / predis包应该在"要求" composer.lock的一部分,而不是" require-dev"。 那么,如何将它从作曲家.lock的require-dev部分转移到简单的要求?我使用Heroku并将其用于简单的"要求" composer.lock中的部分。 谢谢。
答案 0 :(得分:0)
你的composer.lock是正确的。
你必须寻找“包”。 “套餐-dev的”。
predis / predis列在“包”下,因此列出用于生产。
那么你在composer.json中列出的要求部分最终应该转到composer.lock中的包,而require-dev应该转到packages-dev。
我认为你看了laravel / framework的require-dev部分中的predis / predis条目。 这仅适用于laravel / framework,但不适用于您的项目。