日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學(xué)無先后,達(dá)者為師

網(wǎng)站首頁 編程語言 正文

錯(cuò)誤code128:npm ERR! An unknown git error occurred command git --no-replace-objects ls-remote ssh://

作者:云邊的快樂貓 更新時(shí)間: 2024-03-20 編程語言

目錄

一、遇到問題

二、出現(xiàn)問題的原因?

三、解決辦法

四、類似的錯(cuò)誤


一、遇到問題

在使用命令npm install下載依賴項(xiàng)的時(shí)候就遇到了這個(gè)問題,切換了國內(nèi)的淘寶源也下載不了。

npm ERR! code 128
npm ERR! An unknown git error occurred
npm ERR! command git --no-replace-objects ls-remote ssh://git@github.com/nhn/raphael.git
npm ERR! git@github.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! A complete log of this run can be found in:
npm ERR!     D:\IT_base\node16\node_cache\_logs\2023-09-16T05_03_02_827Z-debug-0.log

二、出現(xiàn)問題的原因?

?git上面拉取東西時(shí)候出現(xiàn)了問題

三、解決辦法

1.項(xiàng)目里面執(zhí)行這個(gè)命令

git config --global url."https://".insteadOf ssh://git@

?這個(gè)命令的作用是將 Git 在使用 SSH 克?。ɑ蚶。﹤}庫時(shí)的默認(rèn) URL 協(xié)議從 SSH 更改為 HTTPS。這是一個(gè) Git 的配置設(shè)置,它可以對(duì)你的 Git 操作產(chǎn)生影響。

通常情況下,當(dāng)你使用 SSH 協(xié)議克隆或拉取 Git 倉庫時(shí),URL 的格式是 ssh://git@github.com/username/repo.git,其中 git@github.com 是 SSH URL。但有時(shí),你可能希望將 Git 操作重定向到使用 HTTPS 協(xié)議,例如 https://github.com/username/repo.git,這樣可以避免 SSH 密鑰的設(shè)置和管理。

使用 git config 命令設(shè)置 url."https://".insteadOf ssh://git@ 后,Git 將默認(rèn)使用 HTTPS 協(xié)議而不是 SSH 協(xié)議來訪問遠(yuǎn)程倉庫,以便執(zhí)行克隆、拉取等操作。這對(duì)于那些不想或不需要使用 SSH 密鑰的情況非常有用。

注意,這個(gè)配置是全局配置,會(huì)影響你系統(tǒng)中的所有 Git 倉庫。如果你只想在特定倉庫中使用 HTTPS 協(xié)議,你可以在該倉庫的 .git/config 文件中進(jìn)行配置,而不是全局配置。

2.執(zhí)行下載依賴項(xiàng)的命令

npm install

這樣依賴項(xiàng)就下載成功了

?

四、類似的錯(cuò)誤

解決npm install遇到的問題:Error while executing:_云邊的快樂貓的博客-CSDN博客

原文鏈接:https://blog.csdn.net/m0_52861000/article/details/132917423

  • 上一篇:沒有了
  • 下一篇:沒有了
欄目分類
最近更新