我尝试在设置中添加 spatie/laravel-sluggable ,但在终端中遇到了此错误。我试图搜索此问题,但没有找到任何相关解决方案。
这是错误:
Problem 1
- Conclusion: remove laravel/framework v5.4.36
- Conclusion: don't install laravel/framework v5.4.36
- spatie/laravel-sluggable 2.1.0 requires illuminate/database ~5.5.0
-> satisfiable by illuminate/database[v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44].
- spatie/laravel-sluggable 2.1.5 requires illuminate/database ~5.5.0|~5.6.0|~5.7.0
-> satisfiable by illuminate/database[5.7.17, 5.7.18, 5.7.19, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12, v5.6.13, v5.6.14, v5.6.15, v5.6.16, v5.6.17, v5.6.19, v5.6.2, v5.6.20, v5.6.21, v5.6.22, v5.6.23, v5.6.24, v5.6.25, v5.6.26, v5.6.27, v5.6.28, v5.6.29, v5.6.3, v5.6.30, v5.6.31, v5.6.32, v5.6.33, v5.6.34, v5.6.35, v5.6.36, v5.6.37, v5.6.38, v5.6.39, v5.6.4, v5.6.5, v5.6.6, v5.6.7, v5.6.8, v5.6.9, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9].
- spatie/laravel-sluggable 2.1.6 requires illuminate/database ~5.5.0|~5.6.0|~5.7.0
-> satisfiable by illuminate/database[5.7.17, 5.7.18, 5.7.19, v5.5.0, v5.5.16, v5.5.17, v5.5.2, v5.5.28, v5.5.33, v5.5.34, v5.5.35, v5.5.36, v5.5.37, v5.5.39, v5.5.40, v5.5.41, v5.5.43, v5.5.44, v5.6.0, v5.6.1, v5.6.10, v5.6.11, v5.6.12,
- don't install illuminate/database v5.5.0|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.16|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.17|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.2|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.28|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.33|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.34|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.35|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.36|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.37|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.39|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.40|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.41|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.43|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.5.44|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.6.0|don't install laravel/framework v5.4.36
- don't install illuminate/database v5.6.1|don't install laravel/framework v5.4.36
- Installation request for laravel/framework (locked at v5.4.36, required as 5.4.*)
-> satisfiable by laravel/framework[v5.4.36].
- Installation request for spatie/laravel-sluggable ^2.1
-> satisfiable by spatie/laravel-sluggable[2.1.0, 2.1.1, 2.1.2, 2.1.3, 2.1.4, 2.1.5, 2.1.6].
Installation failed, reverting ./composer.json to its original content.
我也尝试添加illuminate/database
,但也显示出同样的问题。
您始终可以在其 composer.json 文件中验证软件包的要求。
例如,在您的情况下,您可以检查 composer.json 此处:https://github.com/spatie/laravel-sluggable/blob/master/composer.json#l18#l23
您可以注意到这一点:
"require": {
"php" : ">=7.0.0",
"illuminate/database": "~5.5.0|~5.6.0|~5.7.0",
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0"
},
在这里,它说明了所需的最低PHP版本,还提到了illuminate/database
和illuminate/support
软件包版本要求,即 5.5 , 5.6 和 5.7 5.7 >
这些照明包装适用于Laravel。它们是Laravel框架的核心包装,因此它们的版本应与您的Laravel版本匹配。
您不能在较新的Laravel版本上安装旧的照明包。
我建议您升级您的 Laravel到5.5 或最新的。Spatie及其包装大多是最新的,因此您也最好更新。
如果您不想升级到Laravel 5.5,则可以安装spatie/laravel-sluggable
的1.5.2版本,该版本是Laravel 5.4兼容的。
composer require spatie/laravel-sluggable "^1.5"
此软件包spatie/laravel-sluggable
需要:
php: >=7.0.0
illuminate/database: ~5.5.0|~5.6.0|~5.7.0
illuminate/support: ~5.5.0|~5.6.0|~5.7.0
您无法在 Laravel 5.4 Framework
中安装此软件包如果您想使用此(spatie/laravel-sluggable),则需要 laravel 5.5 或更高版本。
如果您的Laravel 5.5或更高,则可以在命令提示符下运行此命令:
composer require spatie/laravel-sluggable
这将为您的项目生成最新版本