英文:
Why does composer ignore the installer-paths in composer.json?
问题
由于现有的公司政策,我必须在默认的 ./vendor
目录之外安装软件包,但Composer顽固地继续在默认的 ./vendor
目录下创建并安装所有内容。
根据常见问题中的说明,我有以下的 composer.json
内容:
"require": {
"monolog/monolog": "*"
},
"extra": {
"installer-paths": {
"3rdparty/": ["type:library"]
}
}
我预期这将在 ./3rdparty
下安装 monolog
,但实际上没有。我漏掉了什么?
英文:
Due to an existing company policy, I have to install packages in a directory other than the default ./vendor
but composer stubbornly continues to create the default ./vendor
directory and install everything there.
As per the FAQ, I have the following composer.json
contents:
"require": {
"monolog/monolog": "*"
},
"extra": {
"installer-paths": {
"3rdparty/": ["type:library"]
}
}
}
~
I expected this to install monolog
under ./3rdparty
but it doesn't. What am I missing?
答案1
得分: 2
我认为可以使用此选项的包列表有限,FAQ 页面底部有一条注释:
> 注意:您不能使用此选项更改任何包的路径。这仅适用于需要 composer/installers 并使用它处理的自定义类型的包。
也许这个存储库可以解决问题?
英文:
I think the list of packages that can use this option is limited, there is a note at the bottom of this FAQ page :
> Note: You cannot use this to change the path of any package. This is only applicable to packages that require composer/installers and use a custom type that it handles.
Maybe this repository will do the trick ?
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论