gpt4 book ai didi

node.js - 如何通过 https 使用私有(private) GitLab 存储库作为带有私有(private) token 的 npm 依赖项

转载 作者:IT老高 更新时间:2023-10-28 23:11:08 27 4
gpt4 key购买 nike

我正在尝试在我的 Node js 应用程序中使用私有(private) GitLab 存储库作为 npm 依赖项,并使用私有(private) token key ,如下所示:

"dependencies": {
"my-module": "git+https://<privateToken>:x-oauth-basic@<myGitLabURL>/<MyUser>/my-module.git"
}

当我运行 npm install 时我收到关于 git clone 的错误 fatal: unable to access <git repo path> 443 Connection 拒绝回复。

我找不到很多关于如何通过 https 而不是通过 ssh 执行此操作的文档。好像是 it does work on GitHub

有人在 GitLab 上使用 Https 有这方面的经验吗?

最佳答案

这个 answer为我工作。

"my-module": "https://oauth2:<PersonalAccessToken>@gitlab.com/<group>/<repository-name>.git

您可以在用户设置->访问 token (GitLab.com Link)下创建个人访问 token 。

关于node.js - 如何通过 https 使用私有(private) GitLab 存储库作为带有私有(private) token 的 npm 依赖项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34439228/

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