我有一个Laravel 8项目,我想升级到Laravel 9。
我看了文件。
我更新了composer.json
文件,如下所述。现在这个文件是这样的(摘录(:
"require": {
"php": "^7.2|^8.0",
"fakerphp/faker": "^1.17",
"fruitcake/laravel-cors": "^2.0",
"guzzlehttp/guzzle": "^7.0.1",
"laravel/framework": "^9.0",
"laravel/sanctum": "^2.11",
"laravel/tinker": "^2.5",
"spatie/laravel-translatable": "^4.6"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.6",
"spatie/laravel-ignition": "^1.0",
"laravel/dusk": "^6.20",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10"
},
当我运行composer update
时,我会出现以下错误:
Problem 1
- illuminate/support[v6.0.0, ..., v6.19.1] require php ^7.2 -> your php version (8.1.2) does not satisfy that requirement.
- illuminate/support[v7.0.0, ..., v7.28.4] require php ^7.2.5 -> your php version (8.1.2) does not satisfy that requirement.
- illuminate/support[v8.0.0, ..., v8.11.2] require php ^7.3 -> your php version (8.1.2) does not satisfy that requirement.
我还尝试删除锁定文件并运行composer install
。我也有同样的错误。我还试图删除版本"^7.2〃;从composer.json中^8.0〃;。没有成功。
我下一步可以尝试什么?
我发现了错误。这是因为"spatie/laravel-translatable": "^4.6"
。
我删除了它并安装了更高版本。现在一切都好了。
现在是这个版本:"spatie/laravel-translatable": "^6.0"