Composer设置忽略版本匹配的方法
程序员文章站
2022-04-05 15:27:10
...
Composer install报错!
Composer 是 PHP 的一个依赖管理工具。它允许你申明项目所依赖的代码库,它会在你的项目中为你安装他们。Composer 不是一个包管理器。是的,它涉及 "packages" 和 "libraries",但它在每个项目的基础上进行管理,在你项目的某个目录中(例如 vendor)进行安装。默认情况下它不会在全局安装任何东西。因此,这仅仅是一个依赖管理。
执行composer install遇到错误:Your requirements could not be resolved to an installable set of packages. 这是因为不匹配composer.json要求的版本。
完整错误如下:
设置composer为国内镜像【速度】
Composer 是 PHP 的一个依赖管理工具。它允许你申明项目所依赖的代码库,它会在你的项目中为你安装他们。Composer 不是一个包管理器。是的,它涉及 "packages" 和 "libraries",但它在每个项目的基础上进行管理,在你项目的某个目录中(例如 vendor)进行安装。默认情况下它不会在全局安装任何东西。因此,这仅仅是一个依赖管理。
执行composer install遇到错误:Your requirements could not be resolved to an installable set of packages. 这是因为不匹配composer.json要求的版本。
完整错误如下:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for arcanedev/support 3.17.0 -> satisfiable by arcanedev/support[3.17.0].
- arcanedev/support 3.17.0 requires php >=5.6 -> your PHP version (5.5.12) does not satisfy that requirement.
Problem 2
- Installation request for laravelista/ekko 1.2.3 -> satisfiable by laravelista/ekko[1.2.3].
- laravelista/ekko 1.2.3 requires php >=5.6.0 -> your PHP version (5.5.12) does not satisfy that requirement.
Problem 3
- Installation request for league/flysystem 1.1.x-dev -> satisfiable by league/flysystem[1.1.x-dev].
- league/flysystem 1.1.x-dev requires php >=5.6.0 -> your PHP version (5.5.12) does not satisfy that requirement.
Problem 4
- Installation request for league/flysystem dev-master -> satisfiable by league/flysystem[dev-master].
- league/flysystem dev-master requires php >=5.6.0 -> your PHP version (5.5.12) does not satisfy that requirement.
Problem 5
- league/flysystem 1.1.x-dev requires php >=5.6.0 -> your PHP version (5.5.12) does not satisfy that requirement.
- laravel/framework 5.2.x-dev requires league/flysystem ~1.0 -> satisfiable by league/flysystem[1.1.x-dev].
- Installation request for laravel/framework 5.2.x-dev -> satisfiable by laravel/framework[5.2.x-dev].
提示我的PHP 7版本太高,不符合composer.json需要的版本,但是在PHP 7下应该也是可以运行的,composer可以设置忽略版本匹配,命令是:composer install --ignore-platform-reqs
or
composer update --ignore-platform-reqs
再次执行composer命令可以正常安装包了。设置composer为国内镜像【速度】
composer config -g repo.packagist composer https://packagist.phpcomposer.com
上一篇: PHP实现二元一次方程式的求解
下一篇: 为什么这样还能提交过去呢?
推荐阅读