尝试安装laravel-image-optimizer插件时出现错误:
$ composer require spatie/laravel-image-optimizer
Using version ^1.4 for spatie/laravel-image-optimizer
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- The requested package spatie/browsershot (locked at 3.30.0, required as ^3.31) is satisfiable by spatie/browsershot[3.30.0] but these conflict with your requirements or minimum-stability.
Installation failed, reverting ./composer.json to its original content.
我的composer.json:
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.1.3",
"alaouy/youtube": "^2.2",
"aloha/twilio": "^4.0",
"arrilot/laravel-widgets": "^3.12",
"beyondcode/laravel-websockets": "^1.0",
"cviebrock/eloquent-sluggable": "^4.5",
"davejamesmiller/laravel-breadcrumbs": "5.x",
"doctrine/dbal": "^2.8",
"elasticquent/elasticquent": "dev-master",
"facebook/graph-sdk": "^5.7",
"fideloper/proxy": "^4.0",
"google/apiclient": "^2.2",
"intervention/image": "^2.4",
"itsgoingd/clockwork": "^3.0",
"jrean/laravel-user-verification": "^7.0",
"laravel/framework": "5.8.*",
"laravel/socialite": "^3.2",
"laravel/tinker": "^1.0",
"laravelium/sitemap": "^3.1",
"maatwebsite/excel": "^3.1",
"mews/captcha": "^2.2",
"mews/purifier": "^2.1",
"proengsoft/laravel-jsvalidation": ">2.2.0",
"pusher/pusher-php-server": "~3.0",
"s-ichikawa/laravel-sendgrid-driver": "~2.0",
"snowfire/beautymail": "dev-master",
"socialiteproviders/instagram": "^3.0",
"spatie/browsershot": "^3.31",
"spatie/laravel-activitylog": "^3.1",
"spatie/laravel-backup": "^6.1",
"spatie/laravel-feed": "^2.1",
"spatie/laravel-newsletter": "^4.2",
"spatie/laravel-tags": "^2.1",
"spipu/html2pdf": "^5.2",
"themsaid/laravel-mail-preview": "^2.0",
"unisharp/laravel-filemanager": "^1.9",
"wboyz/laravel-enum": "^0.2.1",
"willvincent/feeds": "1.1.*",
"yajra/laravel-datatables-oracle": "^9.0.0"
},
"require-dev": {
"barryvdh/laravel-debugbar": "^3.1",
"filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^2.0",
"orangehill/iseed": "^2.6",
"phpunit/phpunit": "^7.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"
],
"post-update-cmd": [
"php artisan vendor:publish --provider=\"Proengsoft\\JsValidation\\JsValidationServiceProvider\" --tag=public --force"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
正如我在这里看到的https://github.com/spatie/browsershot/releases 最新版本是3.31.0
还有我的composer.json
"spatie/browsershot": "^3.31",
是最新版本,就像在spatie / browsershot / releases页面上一样。
我要采取哪些步骤?
谢谢!
答案 0 :(得分:3)
spatie / laravel-image-optimizer软件包需要spatie /浏览器快照,因此您不应单独需要此软件包。您可以这样做:
composer remove spatie/browsershot;
composer require spatie/laravel-image-optimizer;
这两个模块将安装到您的项目中