gpt4 book ai didi

composer-php - Composer 从自托管的 GitLab 实例创建项目

转载 作者:行者123 更新时间:2023-12-02 20:23:47 24 4
gpt4 key购买 nike

我正在尝试使用composer create-projectvendor/name --repository=https://my.self-hosted-gitlab-instance.com/repository.git命令来创建项目。

当我运行命令时,我首先必须输入我的凭据:

Authentication required (my.self-hosted-gitlab-instance.com):
Username: myusername
Password:

我输入了正确的凭据,但随后我得到了:

[Composer\Downloader\TransportException]                                                           


Invalid credentials for 'https://my.self-hosted-gitlab-instance.com/myrepository.git/packages.json', aborting.

最佳答案

如果您使用 URL 作为 --repository 值,它将被视为 composer 类型的存储库。如果你想使用不同的类型,你需要传递带有完整存储库配置的 JSON:

composer create-project vendor/name --repository='{"type": "vcs","url": "https://my.self-hosted-gitlab-instance.com/myrepository.git"}'

composer create-project vendor/name --repository='{"type": "gitlab","url": "https://my.self-hosted-gitlab-instance.com/myrepository.git"}'

--repository: Provide a custom repository to search for the package, which will be used instead of packagist. Can be either anHTTP URL pointing to a composer repository, a path to a localpackages.json file, or a JSON string which similar to what therepositories key accepts.

https://getcomposer.org/doc/03-cli.md#create-project

关于composer-php - Composer 从自托管的 GitLab 实例创建项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50578421/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com