【发布时间】:2021-11-28 09:50:49
【问题描述】:
每当我尝试使用 npm install 从加载到 git 存储库(在 Windows 上)的包中进行安装时,它都会失败:
2494 error An unknown git error occurred
2495 error command git --no-replace-objects ls-remote ssh://git@<SIT>/P_0001_PI/config-loader.git
2496 error <SITE>: Permission denied (publickey).
2496 error fatal: Could not read from remote repository.
2496 error
2496 error Please make sure you have the correct access rights
2496 error and the repository exists.
2497 verbose exit 128
但是,我已经使用ssh-keygen 添加了一个 ssh 密钥,并让 openssh 身份验证器服务自动运行。 (并将钥匙添加到钥匙串中)。
最初 git 本身也出现了问题,但是通过将 GIT_SSH 环境变量添加到用户环境变量来解决这个问题(将值作为窗口的 openssh 可执行文件的位置)。
每当我运行命令时
git --no-replace-objects ls-remote ssh://git@/P_0001_PI/config-loader.git
直接从命令行它可以工作(不要求输入密码,正如预期的那样)。但是在运行npm install 时会弹出上述错误。
【问题讨论】: