报错:Warning: The lock file is not up to date with the latest changes in composer.json

使用composer install报一个警告
报错:Warning: The lock file is not up to date with the latest changes in composer.json_第1张图片

[root@localhost snipe-it]# composer install --no-dev --prefer-source
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update `.
Your lock file does not contain a compatible set of packages. Please run composer update.

  Problem 1
    - tecnickcom/tc-lib-barcode is locked to version 1.17.11 and an update of this package was not requested.
    - tecnickcom/tc-lib-barcode 1.17.11 requires ext-bcmath * -> it is missing from your system. Install or enable PHP's bcmath extension.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php.ini
    - /etc/php.d/10-opcache.ini
    - /etc/php.d/15-xdebug.ini
    - /etc/php.d/20-bz2.ini
    - /etc/php.d/20-calendar.ini
    - /etc/php.d/20-ctype.ini
    - /etc/php.d/20-curl.ini
    - /etc/php.d/20-dom.ini
    - /etc/php.d/20-exif.ini
    - /etc/php.d/20-fileinfo.ini
    - /etc/php.d/20-ftp.ini
    - /etc/php.d/20-gd.ini
    - /etc/php.d/20-gettext.ini
    - /etc/php.d/20-iconv.ini
    - /etc/php.d/20-imap.ini
    - /etc/php.d/20-intl.ini
    - /etc/php.d/20-json.ini
    - /etc/php.d/20-ldap.ini
    - /etc/php.d/20-mbstring.ini
    - /etc/php.d/20-mysqlnd.ini
    - /etc/php.d/20-pdo.ini
    - /etc/php.d/20-phar.ini
    - /etc/php.d/20-simplexml.ini
    - /etc/php.d/20-sockets.ini
    - /etc/php.d/20-sodium.ini
    - /etc/php.d/20-sqlite3.ini
    - /etc/php.d/20-tokenizer.ini
    - /etc/php.d/20-xml.ini
    - /etc/php.d/20-xmlwriter.ini
    - /etc/php.d/20-xsl.ini
    - /etc/php.d/30-mcrypt.ini
    - /etc/php.d/30-mysqli.ini
    - /etc/php.d/30-pdo_mysql.ini
    - /etc/php.d/30-pdo_sqlite.ini
    - /etc/php.d/30-xmlreader.ini
    - /etc/php.d/30-xmlrpc.ini
    - /etc/php.d/30-zip.ini
    - /etc/php.d/40-apcu.ini
    - /etc/php.d/40-xhprof.ini
You can also run `php --ini` in a terminal to see which files are used by PHP in CLI mode.
Alternatively, you can run Composer with `--ignore-platform-req=ext-bcmath` to temporarily ignore these required extensions.

解决:
按提示,可以composer update来更新lock file文件,即:
composer update --lock
或者:运行composer时增加–ignore-platform-req=ext-bcmath
报错:Warning: The lock file is not up to date with the latest changes in composer.json_第2张图片

[root@localhost snipe-it]# composer install --no-dev --prefer-source --ignore-platform-req=ext-bcmath
Installing dependencies from lock file
Verifying lock file contents can be installed on current platform.
Warning: The lock file is not up to date with the latest changes in composer.json. You may be getting outdated dependencies. It is recommended that you run `composer update` or `composer update `.
Package operations: 161 installs, 0 updates, 0 removals
  - Installing symfony/deprecation-contracts (v2.5.0): Cloning 6f981ee24c
The authenticity of host 'github.com (20.205.243.166)' can't be established.
ECDSA key fingerprint is SHA256:p2QAMXNIC1TJYWeIOttrVc98/R1BUFWu3/LiyKgUfQM.
ECDSA key fingerprint is MD5:7b:99:81:1e:4c:91:a5:0d:5a:2e:2e:80:13:3f:24:ca.
Are you sure you want to continue connecting (yes/no)? 

注:
1、Composer 是由 Jordi Boggiano 和 Nils Aderman 创造的一个命令行工具,它的使命就是帮你为项目自动安装所依赖的开发包,它 包含了一个依赖解析器,用来处理开发包之间复杂的依赖关系;还包含下载器、安装器等

2、安装Composer

安装compose很简单:

      curl -sS https://getcomposer.org/installer | php
      mv composer.phar /usr/bin/composer

你可能感兴趣的:(Linux,linux)