composer require第三方包的时候,发生如下错误
D:\study\shop>composer require laravel/jetstream
Using version ^1.6 for laravel/jetstream
./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
- laravel/horizon v5.4.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
- laravel/horizon v5.4.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
- laravel/horizon v5.4.0 requires ext-pcntl * -> the requested PHP extension pcntl is missing from your system.
- Installation request for laravel/horizon (locked at v5.4.0, required as ^5.4) -> satisfiable by laravel/horizon[v5.4.0].
To enable extensions, verify that they are enabled in your .ini files:
- D:\phpstudy_pro\Extensions\php\php7.4.3nts\php.ini
You can also run `php --ini` inside terminal to see which files are used by PHP in CLI mode.
Installation failed, reverting ./composer.json to its original content.
解决方法
带上引包的时候带上 --ignore-platform-reqs
composer require laravel/jetstream --ignore-platform-reqs
参数说明
–ignore-platform-reqs: ignore all platform requirements (php
, hhvm
, lib-*
and ext-*
) and force the installation even if the local machine does not fulfill these. See also the platform
config option
忽略所有平台要求(php,hhvm,lib- *和ext- *)并强制安装,即使本地计算机不满足这些要求