【发布时间】:2018-10-26 15:36:57
【问题描述】:
场景:
- 我开发了某种节点模块。
- 后来我才知道,与其将我的节点模块发布到 npm 存储库,我可以使用我自己的 Gitlab 存储库将其用作节点模块。
约束是:
- 我必须为此活动使用私人仓库
- 我必须使用 https url 来获取 repo
所以在谷歌搜索了几个小时后,我找到了一个解决方案,其中包括直接来自 git 存储库的依赖项。
因此我的依赖看起来像:
"my-module": "git+https://myusername:myaccesstoken@gitlab.com:Organization/Project.git#develop"
如果我执行npm install 会导致:
npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t ssh://git@gitlab.com/organization/project.git
npm ERR!
npm ERR! Permission denied (publickey).
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
npm ERR! A complete log of this run can be found in:
npm ERR! /home/username/.npm/_logs/2018-05-16T13_25_37_053Z-debug.log
【问题讨论】:
标签: node.js git npm gitlab node-modules