Your lock file does not contain a compatible set of packages. Please run composer update

准备折腾一下WebStack-Laravel这个项目,clone代码到本地之后,当我执行composer install时,出现了提示:Your lock file does not contain a compatible set of packages. Please run composer update;具体信息如下:

Problem 1
– mews/captcha is locked to version 2.2.5 and an update of this package was not requested.
– mews/captcha 2.2.5 requires ext-gd * -> it is missing from your system. Install or enable PHP’s gd extension.
Problem 2
– meyfa/php-svg is locked to version v0.9.1 and an update of this package was not requested.
– meyfa/php-svg v0.9.1 requires ext-gd * -> it is missing from your system. Install or enable PHP’s gd extension.
Problem 3
– symfony/thanks is locked to version v1.1.0 and an update of this package was not requested.
– symfony/thanks v1.1.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.0.0] but it does not match the constraint.
Problem 4
– mews/captcha 2.2.5 requires ext-gd * -> it is missing from your system. Install or enable PHP’s gd extension.
– james.xue/login-captcha 1.7 requires mews/captcha ^2.2 -> satisfiable by mews/captcha[2.2.5].
– james.xue/login-captcha is locked to version 1.7 and an update of this package was not requested.

To enable extensions, verify that they are enabled in your .ini files:
– /etc/php/7.4/cli/php.ini
– /etc/php/7.4/cli/conf.d/10-opcache.ini
– /etc/php/7.4/cli/conf.d/10-pdo.ini
– /etc/php/7.4/cli/conf.d/15-xml.ini
– /etc/php/7.4/cli/conf.d/20-calendar.ini
– /etc/php/7.4/cli/conf.d/20-ctype.ini
– /etc/php/7.4/cli/conf.d/20-dom.ini
– /etc/php/7.4/cli/conf.d/20-exif.ini
– /etc/php/7.4/cli/conf.d/20-ffi.ini
– /etc/php/7.4/cli/conf.d/20-fileinfo.ini
– /etc/php/7.4/cli/conf.d/20-ftp.ini
– /etc/php/7.4/cli/conf.d/20-gettext.ini
– /etc/php/7.4/cli/conf.d/20-iconv.ini
– /etc/php/7.4/cli/conf.d/20-json.ini
– /etc/php/7.4/cli/conf.d/20-mbstring.ini
– /etc/php/7.4/cli/conf.d/20-phar.ini
– /etc/php/7.4/cli/conf.d/20-posix.ini
– /etc/php/7.4/cli/conf.d/20-readline.ini
– /etc/php/7.4/cli/conf.d/20-shmop.ini
– /etc/php/7.4/cli/conf.d/20-simplexml.ini
– /etc/php/7.4/cli/conf.d/20-sockets.ini
– /etc/php/7.4/cli/conf.d/20-sysvmsg.ini
– /etc/php/7.4/cli/conf.d/20-sysvsem.ini
– /etc/php/7.4/cli/conf.d/20-sysvshm.ini
– /etc/php/7.4/cli/conf.d/20-tokenizer.ini
– /etc/php/7.4/cli/conf.d/20-xmlreader.ini
– /etc/php/7.4/cli/conf.d/20-xmlwriter.ini
– /etc/php/7.4/cli/conf.d/20-xsl.ini
You can also run php --ini inside terminal to see which files are used by PHP in CLI mode.

You are using Composer 2, which some of your plugins seem to be incompatible with. Make sure you update your plugins or report a plugin-issue to ask them to support Composer 2.

报错示意图:

从提示可以看出,我的PHP7版本不符合composer.json里面需要的版本,但在PHP 7下应该也是可以运行的。那么可以在执行composer命名时,可以设置忽略版本匹配,安装命名:

composer install --ignore-platform-reqs

更新命名:

composer update --ignore-platform-reqs

执行这个操作后的结果如下:

问题得到了解决!

Sea Bridge

古之立大志者,不惟有超世之才 亦必有坚韧不拔之志!

发表评论