情景:
约束是:
因此,谷歌搜索了几个小时后,我找到了一个解决方案,其中包括直接从git存储库中包含dependecy。
因此我的依赖关系如下:
"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
答案 0 :(得分:0)
假设您按照此SO answer
中的说明执行了设置访问令牌的步骤你可以尝试删除项目网址末尾的.git扩展名,所以看起来应该是
"my-module": "git+https://myusername:myaccesstoken@gitlab.com:organization/project#develop"
所以@
之后的所有内容都应该是gitlab上项目的确切网址,如地址栏中所示