【发布时间】:2018-03-08 18:20:56
【问题描述】:
获取本地存储库的权限被拒绝错误,我可以成功克隆它,但是 npm install:npm install 出现错误
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@stash.company.com:2222/castor/module-name.git
npm ERR!
npm ERR! git@stash.company.com: 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! C:\Users\MOEL3\AppData\Roaming\npm-cache\_logs\2018-03-08T18_12_33_006Z-debug.log
但是,每次我执行有关远程 repo pull、push 等的 git 命令时,我都必须输入密码……这会是原因吗?如何解决这个问题?
【问题讨论】:
-
如果您使用 ssh 连接到 GitHub,请尝试使用
eval $(ssh-agent -s)后跟ssh-add ~/.ssh/id_rsa,其中id_rsa是您的公钥。 -
问题发生在 windows 而非 linux 上
-
这些是 windows 指令,使用 Git Bash -> help.github.com/articles/…
标签: node.js git npm-install permission-denied bitbucket-server