解決終端無法訪問github.com 的錯誤


錯誤情況

  1. pac文件中已經添加域名,瀏覽器可以訪問github.com,但終端ping不通。
  2. 使用yarn install 安裝依賴,一直遇到 fatal: unable to access 'https://github.com/protobuf.js/': LibreSSL SSL_read: Operation timed out, errno 60 的錯誤。
  3. 使用 git clone https://github.com/protobuf.js.git 可以拉取倉庫。

解決辦法

  1. 搜索github.com 的IP地址, 網址 Hostname to IP Address.
  2. 發現IP是 140.82.112.4, 且可以ping通。
  3. 將這個IP加入host文件, sudo vi /etc/hosts
  4. 再次 ping github.com, 成功

解決辦法2

  1. 直接從你的代理軟件中選擇 Copy HTTP Proxy Shell Export Line
  2. 在終端中黏貼: export http_proxy="http://127.0.0.1:8001"; export HTTP_PROXY="http://127.0.0.1:8001"; export https_proxy="http://127.0.0.1:8001"; export HTTPS_PROXY="http://127.0.0.1:8001"


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM