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

學無先后,達者為師

網站首頁 編程語言 正文

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

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

目錄

一、遇到問題

二、出現問題的原因?

三、解決辦法

四、類似的錯誤


一、遇到問題

在使用命令npm install下載依賴項的時候就遇到了這個問題,切換了國內的淘寶源也下載不了。

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

二、出現問題的原因?

?git上面拉取東西時候出現了問題

三、解決辦法

1.項目里面執行這個命令

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

?這個命令的作用是將 Git 在使用 SSH 克隆(或拉取)倉庫時的默認 URL 協議從 SSH 更改為 HTTPS。這是一個 Git 的配置設置,它可以對你的 Git 操作產生影響。

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

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

注意,這個配置是全局配置,會影響你系統中的所有 Git 倉庫。如果你只想在特定倉庫中使用 HTTPS 協議,你可以在該倉庫的 .git/config 文件中進行配置,而不是全局配置。

2.執行下載依賴項的命令

npm install

這樣依賴項就下載成功了

?

四、類似的錯誤

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

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

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