我有一个内置于 laravel 5.8 的项目,当我运行composer update
时,似乎已将PC上的laravel安装更新为6.0,这会引发错误
我的composer.json
在下面
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^7.2",
"barryvdh/laravel-ide-helper": "^2.6",
"fideloper/proxy": "^4.0",
"kalnoy/nestedset": "^5.0",
"laravel/framework": "5.8.*",
"laravel/tinker": "^1.0",
"realrashid/sweet-alert": "^2.0",
"unicodeveloper/laravel-paystack": "^1.0",
"watson/active": "^4.0",
"webpatser/laravel-uuid": "^3.0"
},
"require-dev": {
"facade/ignition": "^1.4",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^3.0",
"phpunit/phpunit": "^8.0"
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"autoload": {
"psr-4": {
"App\\": "app/"
},
"classmap": [
"database/seeds",
"database/factories"
]
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
}
}
答案 0 :(得分:0)
您会收到此错误,因为composer.json
中的某些依赖项需要laravel/framework v5.8.35
的较低版本或较高版本。
这里有个提示,如果您的应用程序没有使用依赖项,请遍历composer.json
文件,然后从composer.json文件中删除它们。
然后运行
composer update
如果仍然不能解决问题,请尝试安装较低版本的laravel/framework
例如,
composer require laravel/framework:1.*
或尝试安装最新版本的laravel/framework
composer install laravel/framework:5.3.*