composer require php-mqtt/client 报错的问题
The "topthink/think-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.3.0"). You may need to run composer update with the "--no-p
lugins" option.
The "2.1" constraint for "php-mqtt/client" appears too strict and will likely not match what you want. See https://getcomposer.org/constraints
./composer.json has been updated
The "topthink/think-installer" plugin was skipped because it requires a Plugin API version ("^1.0") that does not match your Composer installation ("2.3.0"). You may need to run composer update with the "--no-p
lugins" option.
Running composer update php-mqtt/client
Loading composer repositories with package information
Updating dependencies
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Root composer.json requires php-mqtt/client 2.1, found php-mqtt/client[dev-feature-redis-repository-on-master, dev-master, v0.1.0, ..., 0.3.x-dev, v1.0.0-rc1, ..., v1.8.0] but it does not match the constr
aint.
Problem 2
- topthink/think-installer v1.0.12 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.3.0] but it does not match the constraint.
- topthink/framework v5.0.23 requires topthink/think-installer ~1.0 -> satisfiable by topthink/think-installer[v1.0.12].
- topthink/framework is locked to version v5.0.23 and an update of this package was not requested.
运行 下面命令
composer update --no-plugins
安装成功
composer require php-mqtt/client
Cannot use php-mqtt/client's latest version v1.8.0 as it requires php ^7.4|^8.0 which is not satisfied by your platform.
./composer.json has been updated
Running composer update php-mqtt/client
Loading composer repositories with package information
Updating dependencies
Lock file operations: 2 installs, 0 updates, 0 removals
- Locking php-mqtt/client (v0.3.0)
- Locking psr/log (1.1.4)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 2 installs, 0 updates, 0 removals
- Installing psr/log (1.1.4): Extracting archive
- Installing php-mqtt/client (v0.3.0): Extracting archive
Generating autoload files
Found 6 security vulnerability advisories affecting 1 package.
Run composer audit for a full list of advisories.
Using version ^0.3.0 for php-mqtt/client