Composer常见错误解决

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

完整错误如下:

vagrant@homestead:/usr/share/nginx/html/laravel-blog$ sudocomposerinstall

Loadingcomposerrepositorieswithpackage information

Installingdependencies (includingrequire-dev) fromlockfile

Yourrequirementscouldnot beresolvedto aninstallablesetofpackages.

Problem 1

- Installationrequestfor doctrine/instantiator 1.0.3 -> satisfiablebydoctrine/instantiator[1.0.3].

提示我的PHP 7版本太高,不符合composer.json需要的版本,但是在PHP 7下应该也是可以运行的,composer可以设置忽略版本匹配,命令是:

composer install --ignore-platform-reqs
composer update --ignore-platform-reqs

再次执行composer命令可以正常安装包了。

联系我们

邮箱 626512443@qq.com
电话 18611320371(微信)
QQ群 235681453

Copyright © 2015-2024

备案号:京ICP备15003423号-3