【发布时间】:2022-11-02 03:05:47
【问题描述】:
我的作曲家有问题 在VM实例中,安装了php和一些包(在composer.lock文件中列出) 当我尝试在本地安装新包时(我从另一个 VM 复制包文件夹可以通过互联网安装),列出已安装包的旧 composer.lock 将被替换为我安装的仅新包的信息。
步:
我用新包更新 composer.json
{
"repositories": [
{
"packagist": false
},
{
"type": "path",
"url": "/path/to/artifact/"
}
],
"require": {
"firebase/php-jwt": "^6.4"
}
}
然后运行 php composer.phar 更新
new package installed but composer.lock just have only new package(php-jwt) all other contents deleted
Loading composer repositories with package information
Updating dependencies
Lock file operations: 1 install, 0 updates, 50 removals
- Removing cakephp/debug_kit (2.2.9)
- Removing clue/stream-filter (v1.6.0)
- Removing composer/installers (v1.12.0)
- Removing doctrine/instantiator (1.4.1)
...
- Locking firebase/php-jwt (6.4.0)
Writing lock file
Installing dependencies from lock file (including require-dev)
Package operations: 1 install, 0 updates, 0 removals
- Downloading firebase/php-jwt (6.4.0)
- Installing firebase/php-jwt (6.4.0): Extracting archive
1 package suggestions were added by new dependencies, use `composer suggest` to see details.
Generating autoload files
No security vulnerability advisories found
我可以做些什么来安装新包和更新(附加)信息到 composer.lock 而不是只添加新包?
更新:我将更新命令更改为要求,结果相同
php composer.phar require /path/to/artifact/
【问题讨论】:
-
更新锁意味着重写它。锁的概念中没有附加或类似的东西。
-
感谢@hakre 的信息,您对安装新软件包和更新锁定文件有任何想法吗?
标签: php composer-php