我有这个Laravel composer.json,它是在运行composer create-project --prefer-dist laravel/laravel博客后自动创建的。
不幸的是,当我运行作曲家安装时。它只安装 38 个而不是 26 个必需的软件包。
网站上的错误消息是:
Class 'BeyondCodeDumpServerDumpServerServiceProvider' not found
作曲家配置:
{
"name": "laravel-distro",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.1.3",
"fideloper/proxy": "^4.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"laravel/installer": "^2.0.1"
},
"require-dev": {
"beyondcode/laravel-dump-server": "^1.0",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"phpunit/phpunit": "^7.5"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"vendor-dir": "vendor",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true
}
已安装的软件包:
[laravel-distro &cli-image laravel-distro]php:/app$ ls vendor
autoload.php composer doctrine egulias fideloper jakub-onderka league nesbot opis phpoption psy ramsey symfony vlucas
bin dnoegel dragonmantank erusev guzzlehttp laravel monolog nikic paragonie psr ralouphie swiftmailer tijsverkoyen
[laravel-distro &cli-image laravel-distro]php:/app$ ls vendor_backup/
autoload.php composer dragonmantank fideloper hamcrest league myclabs nunomaduro phar-io phpspec psy swiftmailer tijsverkoyen
beyondcode dnoegel egulias filp jakub-onderka mockery nesbot opis phpdocumentor phpunit ramsey symfony vlucas
bin doctrine erusev fzaninotto laravel monolog nikic paragonie phpoption psr sebastian theseer webmozart
[laravel-distro &cli-image laravel-distro]php:/app$
问题可能是composer.lock
与composer.json
不同步。尝试运行
composer install
并确保您没有这样的消息:
锁定文件不是最新的 composer.json 中的最新更改
如果你这样做,这意味着有人忘记提交composer.lock
- 最简单的解决方案是运行:
作曲家更新
这将导致所有软件包都将被更新(如果软件包中的某些内容被更改,可能会导致一些问题(,但它也应该安装所有不在文件中但在composer.json
中列出的软件包composer.lock