简体   繁体   中英

composer.phar install older packages

I have a problem with "Composer" When I use Composer from my notebook with Linux operating system, Composer install older versions of components than those installed. When I use Composer from my Windows PC in the office everything works fine (using the same "composer.phar" file under version control).

What could be the problem? The command I use is php composer.phar update from project directory.

Thanks in advance for your answers

Most likely this is because you have a composer.lock file on your linux machine. Composer has two main commands: install and update .

Install will check if a composer.lock file is present. If it is, that file will be used to determine which versions of the dependencies to install. If not, it will implicitly do an update to get the latest matching versions.

Update will always try to get the latest matching versions and then write those into the composer.lock file.

The suggestion here would be to:

  • Commit your composer.lock into version control (remove it from .gitignore ).
  • Run composer update on your linux machine to get the latest versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM