gpt4 book ai didi

git - 克隆 repo : Permission denied (publickey) 期间 yarn 失败

转载 作者:行者123 更新时间:2023-12-03 23:56:37 27 4
gpt4 key购买 nike

我正在尝试使用 Mac OS X 10.12 在我的桌面上本地构建这个项目:
https://github.com/lionsharecapital/lionshare-desktop

当我运行 yarn 时,我得到:

yarn install v0.27.5
[1/4] Resolving packages...
[2/4] Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: clone ssh://git@github.com/prettier/prettier.git /Users/patrick/Library/Caches/Yarn/v1/.tmp/998d9289033d5404a23434d3979d79dc
Directory: /Users/patrick/dev/lionshare-desktop
Output:
Cloning into '/Users/patrick/Library/Caches/Yarn/v1/.tmp/998d9289033d5404a23434d3979d79dc'...
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.

super 迷茫,我手动跑了 git clone ssh://git@github.com/prettier/prettier.git /Users/patrick/Library/Caches/Yarn/v1/.tmp/998d9289033d5404a23434d3979d79d
它工作得很好......所以,当 yarn 使用 git 时,它没有使用我的全局 git 配置?

我怎样才能解决这个问题?

更新

在另一台计算机上尝试这个奇怪地没有这个问题,但是安装后,我按照他们的说明做了:
yarn run dev

但我得到:
yarn run v0.27.5
$ concurrently -k 'node desktop/server.dev.js' 'npm start'
[1] module.js:487
[1] throw err;
[1] ^
[1]
[1] Error: Cannot find module 'update-notifier'
[1] at Function.Module._resolveFilename (module.js:485:15)
[1] at Function.Module._load (module.js:437:25)
[1] at Module.require (module.js:513:17)
[1] at require (internal/module.js:11:18)
[1] at /usr/local/lib/node_modules/npm/bin/npm-cli.js:29:19
[1] at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
[1] at Module._compile (module.js:569:30)
[1] at Object.Module._extensions..js (module.js:580:10)
[1] at Module.load (module.js:503:32)
[1] at tryModuleLoad (module.js:466:12)
[1] npm start exited with code 1
[0] listening on 3000
--> Sending SIGTERM to other processes..
[0] node desktop/server.dev.js exited with code null
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

第二次更新

所以显然通过运行 yarn,我完全破坏了 npm,因为我发现如果我尝试对 npm 做任何事情,我会得到同样的错误:
>npm
module.js:487
throw err;
^

Error: Cannot find module 'update-notifier'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at /usr/local/lib/node_modules/npm/bin/npm-cli.js:29:19
at Object.<anonymous> (/usr/local/lib/node_modules/npm/bin/npm-cli.js:92:3)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)

这似乎是一场灾难!

更新 3

卸载节点并重新安装并没有解决这个问题,我不得不删除 ~/.npm 和/usr/local/lib/node_modules,然后卸载节点并重新安装,现在 npm 又可以工作了......天哪......关于如何的任何想法我可以在不破坏我的开发环境的情况下构建这个项目吗?

最佳答案

yarn install使用 ssh-add 代理通过 GitHub 获取私有(private)仓库。您可以绕过并手动运行git clone ssh://....或者您可以将您的 ssh key 添加到 ssh-add。一、检查是否没有添加ssh key

ssh-add -l
这必须显示一个键,如果它显示 代理没有身份 ,然后,您需要在此处添加您的 ssh key 。您可以添加使用
ssh-add <path-to-ssh-key>
这将完成它。

关于git - 克隆 repo : Permission denied (publickey) 期间 yarn 失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45428949/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com