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即可。

你可能感兴趣的:(php,库)