Composer软件包已更新但未安装 [英] Composer packages update but don't install
问题描述
完成后
sudo php composer.phar update
我得到以下信息:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Installing SOME_PACKAGE (dev-master 6fb0f62)
Cloning SOME_TOKEN
Writing lock file Generating autoload filesUpdating
但是当我做sudo php composer.phar install
我会得到
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
有人对可能发生的事情有任何想法吗?我在同一个文件夹中都有一个composer.json, composer.phar and composer.lock
.
Does someone have any idea on what might be happening? I have a composer.json, composer.phar and composer.lock
all in the same folder.
推荐答案
您认为出了什么问题?使用composer update
,composer尝试在指定的版本范围内查找软件包的新版本.找到后,它将更新程序包.最后,它将创建一个composer.lock
文件,其中包含所有软件包以及有关已安装版本的详细信息.
What is wrong in your opinion? With composer update
, composer tries to find new versions of the packages within the specified version range. When found, it updates the package. At the end, it creates a composer.lock
file with all packages and details about the installed versions.
composer install
仅读取此composer.lock
文件,并完全安装此文件中指定的版本.由于您已经在该锁定文件中指定了版本,因此不会发生任何事情.
composer install
only reads this composer.lock
file and installs exactly the versions specified in this. Since you already have the versions specified in that lock file, nothing will happen.
composer install
在生产服务器和团队中非常有用,因为您可以确保所有人都使用完全相同版本的依赖项.
composer install
is very usefull on production servers and in teams, as you'll be sure you all are using exact the same version of the dependencies.
这篇关于Composer软件包已更新但未安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!