composer install报错
PS C:\Users\duhbb\PhpstormProjects\php-html-parser> composer install No composer.lock file present. Updating dependencies to latest instead of installing from lock file. See https://getcomposer.org/install for more information. 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 infection/infection ^0.13.4 -> satisfiable by infection/infection[0.13.4, 0.13.5, 0.13.6]. - infection/infection[0.13.4, ..., 0.13.6] require php ^7.1.3 -> your php version (8.1.10) does not satisfy that requirement. Problem 2 - phpunit/phpunit[7.5.1, ..., 7.5.20] require php ^7.1 -> your php version (8.1.10) does not satisfy that requirement. - Root composer.json requires phpunit/phpunit ^7.5.1 -> satisfiable by phpunit/phpunit[7.5.1, ..., 7.5.20].
查看了下资料说是php版本不符,打开composer.json发现代码只要求大于7.0.0可仍然报这个错误,不用太较真执行如下代码之后在运行之前的代码就ok。
composer install --ignore-platform-reqs # 或者 composer update --ignore-platform-reqs
参考
文章评论