今天我在 macOS(英特爾芯片)中執行 yarn 命令時,顯示如下錯誤:
$ yarn ?ruby-2.7.2?
yarn install v1.21.1
warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] ?? Resolving packages...
warning webpack > watchpack > watchpack-chokidar2 > chokidar > fsevents > [email protected]: Please upgrade to @mapbox/node-pre-gyp: the non-scoped node-pre-gyp package is deprecated and only the @mapbox scoped package will recieve updates in the future
[2/4] ?? Fetching packages...
error Command failed.
Exit code: 128
Command: git
Arguments: ls-remote --tags --heads ssh://[email protected]/jiangxiaoqiang/js-wheel.git
Directory: /Users/dolphin/source/reddwarf/frontend/Cruise-Radar
Output:
[email protected]: 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.
(base)
我js-wheel像這樣配置in package.json:
"js-wheel": "jiangxiaoqiang/js-wheel",
即使回購是公開的,為什么還要告訴我權限被拒絕?我嘗試使用此命令生成 rsa 密鑰:
$ ssh-keygen -t rsa -b 4096 -C “[email protected]” ?ruby-2.7.2?
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/dolphin/.ssh/id_rsa):
/Users/dolphin/.ssh/id_rsa already exists.
Overwrite (y/n)?
(base)
我應該怎么做才能避免這個問題?
uj5u.com熱心網友回復:
您首先需要檢查是否對ssh -Tv [email protected]您進行了身份驗證,這意味著它的輸出是否以帶有您的 GitHub 用戶名的問候訊息結尾。
只要那行不通,agit ls-remote ssh://[email protected]/...就行不通。
另一種方法是強制使用 HTTPS URL:
git config --global url.https://github.com/.insteadOf [email protected]:
這尤其適用于公共存盤庫,因為不需要憑據。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/435856.html
