来自gitlab的npm安装模块

时间:2015-12-09 21:27:13

标签: node.js https npm install gitlab

在节点模块package.json中我有:

"repository" : {
"type":"git",
"url":"https://git.domainName.com/Mastash3ff/someprojectname.git"
},

尝试通过npm安装。
尝试了来自https://docs.npmjs.com/cli/install的各种命令:

npm install gitlab:git.domainName.com/Mastash3ff/someProjectName.git

也尝试了

npm install https://git.domainName.com/Mastash3ff/someProjectName.git

按下enter后,

https:// install命令挂起。 npm install gitlab命令吐出:

npm ERR! git clone --template=/home/Mastash3ff/.npm/_git-remotes/_templates --mirror git@gitlab.com:git.domainName.com/Mastash3ff%2FsomeProjectName.git /home/Mastash3ff/.npm/_git-remotes/git-gitlab-com-git-domainName-com-Mastash3ff-2FsomeProjectName-git-a88a1dff9012cf9dc7b0780cba303741: Cloning into bare repository '/home/Mastash3ff/.npm/_git-remotes/git-gitlab-com-git-domainName-com-Mastash3ff-2FsomeProjectName-git-a88a1dff9012cf9dc7b0780cba303741'...
npm ERR! git clone --template=/home/Mastash3ff/.npm/_git-remotes/_templates --mirror git@gitlab.com:git.domainName.com/Mastash3ff%2FsomeProjectName.git /home/Mastash3ff/.npm/_git-remotes/git-gitlab-com-git-domainName-com-Mastash3ff-2FsomeProjectName-git-a88a1dff9012cf9dc7b0780cba303741: Permission denied (publickey).
npm ERR! git clone --template=/home/Mastash3ff/.npm/_git-remotes/_templates --mirror git@gitlab.com:git.domainName.com/Mastash3ff%2FsomeProjectName.git /home/Mastash3ff/.npm/_git-remotes/git-gitlab-com-git-domainName-com-Mastash3ff-2FsomeProjectName-git-a88a1dff9012cf9dc7b0780cba303741: fatal: Could not read from remote repository.
.....

对于gitlab,我们没有ssh auth设置,所以我们只使用https://。不知道为什么要求公钥。我们git clone的方法是将其指向cert文件。我的〜/ .npmrc文件也指向:

  cafile=/home/Mastash3ff/git.someDomainName.com.cert

我没有想法。我希望这个问题可以解决,我指出错误的npm install命令用法:/

1 个答案:

答案 0 :(得分:0)

检查您对回购的访问权限。

  

许可被拒绝(公钥)