composer 安装出错的解决办法

1,112 阅读1分钟

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

执行composer install遇到错误:Your requirements could not be resolved to an installable set of packages. 这是因为不匹配composer.json要求的版本。

$ composer install

Your requirements could not be resolved to an installable set of packages.

Problem 1 - laravel-notification-channels/webpush 3.0.0 requires minishlink/web-push ^2.0 -> satisfiable by minishlink/web-push[v2.0.0, v2.0.1]. - laravel-notification-channels/webpush 3.0.1 requires minishlink/web-push ^2.0 -> satisfiable by minishlink/web-push[v2.0.0, v2.0.1]. - minishlink/web-push v2.0.0 requires mdanter/ecc ^0.5.0 -> satisfiable by mdanter/ecc[v0.5.0, v0.5.1, v0.5.2]. - minishlink/web-push v2.0.1 requires mdanter/ecc ^0.5.0 -> satisfiable by mdanter/ecc[v0.5.0, v0.5.1, v0.5.2]. - mdanter/ecc v0.5.2 requires ext-gmp * -> the requested PHP extension gmp is missing from your system. - mdanter/ecc v0.5.1 requires ext-gmp * -> the requested PHP extension gmp is missing from your system. - mdanter/ecc v0.5.0 requires ext-gmp * -> the requested PHP extension gmp is missing from your system. - Installation request for laravel-notification-channels/webpush ^3.0 -> satisfiable by laravel-notification-channels/webpush[3.0.0, 3.0.1].

To enable extensions, verify that they are enabled in your .ini files: - /usr/local/php7.2.9/etc/php.ini You can also run php --ini inside terminal to see which files are used by PHP in CLI mode. 提示我的PHP 7版本太高,不符合composer.json需要的版本,但是在PHP 7下应该也是可以运行的,composer可以设置忽略版本匹配,命令是:

$ composer install --ignore-platform-reqs

或者

$ composer update --ignore-platform-reqs ———————————————— 版权声明:本文为CSDN博主「飞鱼计划」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。 原文链接:blog.csdn.net/qq_35669659…