为什么在本地和全局安装Composer会回滚到其他版本? [英] Why local and global installations of Composer rolls back to a different version?
问题描述
我同时拥有本地的(每个项目-由 php composer.phar
执行)和全局的(由 composer
)安装在Windows上的版本。今天,我更新了两者,并注意到此更新的结果很奇怪。
I have both local (per project -- executed by php composer.phar
) and global (executed by composer
) versions installed on my Windows. Today I updated both and noticed weird results of this update.
对于全局安装:
$ composer self-update
Updating to version 92faf1c7a83a73794fb914a990be435e1df373ca.
Downloading: 100%
Use composer self-update --rollback to return to version 42bfe9c56adb555cc08e9ce
2d32f6763ff75ae5d
对于本地版本:
$ php composer.phar self-update
Updating to version 92faf1c7a83a73794fb914a990be435e1df373ca.
Downloading: 100%
Use composer self-update --rollback to return to version 943107cfe717a74aa791f57
b87fa514c88582b0d
两个安装都更新为最新版本( 92faf1c7a83a73794fb914a990be435e1df373ca
)版本,但两者都显示了不同的版本号,它们将回滚到/ strong>。为什么?我缺少什么?
Both installations were updated to newest (92faf1c7a83a73794fb914a990be435e1df373ca
) version, but both showed different version number they'll be rolled back to. Why? What am I missing?
另外,事实证明,最新版本的Composer(最新快照)存在一些错误。同时运行 composer update
或 php composer.phar update
会发出如下通知:
In addition, it turned out, that newest version (latest snapshot) of Composer has some bugs. Running both composer update
or php composer.phar update
throws a bunch of notices like that:
Deprecation Notice: Composer\Package\Version\VersionParser::parseLinks is deprec ated. Use \Composer\Package\Loader\ArrayLoader::parseLinks() instead in phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Package/Version/VersionParser.php:226
因此,我决定回退这两个安装。而且,正如我答应的那样,两个安装都回滚到不同的先前版本。
Thus, I decided to roll back both installations. And, as I was "promised", both installations were rolled back to a different previous versions.
对于全局安装:
$ composer self-update --rollback
Rolling back to version 2015-07-12_15-39-36-42bfe9c.
对于本地用户:
$ php composer.phar self-update --rollback
Rolling back to version 2015-06-26_13-40-26-943107c.
这样,最初的问题就会返回。为什么两个安装都总是更新到同一版本(最新版本),却又回滚到另一个版本?
This way, the initial question returns. Why both my installations always updates to the same version (newest one), but rolls back to a different one?
推荐答案
试试
php composer.phar global require fxp / composer-asset-plugin:1.0.1
或
composer global要求 fxp / composer-asset-plugin:1.0.1
php composer.phar global require "fxp/composer-asset-plugin:1.0.1" or composer global require "fxp/composer-asset-plugin:1.0.1"
这篇关于为什么在本地和全局安装Composer会回滚到其他版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!