【发布时间】:2019-06-21 14:51:24
【问题描述】:
我正在尝试安装一个存在于我们私人仓库中的包。目标是与合作伙伴共享存储库,但我需要确保他们可以安装它。从理论上讲,它应该可以工作,但没有一个记录在案的解决方案对我有用
我已经尝试将包添加到 package.json 文件中
"dependencies": {
"package_name": "git+https://<deploy-token-name>:<deploy-token>@gitlab.domain.com/group/repo.git"
}
然后使用 npm 安装,但似乎在部署令牌上失败,但很难说,因为日志不是很有帮助,然后我们的整个 gitlab 部署暂时停止#fun
29 error
29 error undefined
29 error exited with error code: 128
我也尝试过使用私有访问令牌
"package-name": "https://oauth2:<access-token>@gitlab.domain.com/group/repo.git"
这导致了一个我可以理解的实际错误,除了错误是说存储库中没有 package.json,但肯定有
npm ERR! package.json Non-registry package missing package.json: package-name@https://oauth2:<access-token>@gitlab.domain.com/group/repo.git.
npm ERR! package.json npm can't find a package.json file in your current directory.
我已尝试使用 ssh(使用适用于提交等的 ssh 密钥设置)
git+ssh://git@my-domain.com:my-project/my-repo#my-branch
这会导致错误
npm ERR! premature close
我已经阅读了十几个相关的问题和文章,但没有什么对我有用
【问题讨论】:
-
你能解决这个问题吗?