composer install php版本与composer.lock文件要求不一致

在从仓库拉下代码的时候,安装包的时候出现如下问题:

root@iZwz9h8g1nh0vb5lh0jqveZ:/bcc/production/BCCAdminV1.0# composer install
Do not run Composer as root/super user! See https://getcomposer.org/root for details
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 doctrine/instantiator 1.1.0 -> satisfiable by doctrine/instantiator[1.1.0].
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
Problem 2
- doctrine/instantiator 1.1.0 requires php ^7.1 -> your PHP version (7.0.22) does not satisfy that requirement.
- phpunit/phpunit-mock-objects 2.3.8 requires doctrine/instantiator ^1.0.2 -> satisfiable by doctrine/instantiator[1.1.0].
- Installation request for phpunit/phpunit-mock-objects 2.3.8 -> satisfiable by phpunit/phpunit-mock-objects[2.3.8].

上面意思有两个:
1、不要用root运行composer,因为包可能不安全,但是还是可以运行安装的;
2、composer.lock文件里面要求php版本是7.1以上的,我的php版本才7.0.22不符合要求。

解决办法:
1、创建一个普通用户;
2、把composer.lock文件转移到点的别的地方备份一下,然后再次运行composer install即可。

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

SHUIPING_YANG

你的鼓励是我创作的最大动力。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值