Devtools: Failed to connect to api.github.com

Created on 3 Nov 2018  Â·  10Comments  Â·  Source: r-lib/devtools

I am unable to use devtools::install_github() to install packages.
Every time I try I receive the following error. I've tried with firewall turned off. Please help!

> devtools::install_github("dkahle/ggmap")
Error in curl::curl_fetch_memory(url, handle = h) : 
  Failed to connect to api.github.com port 80: Timed out

Most helpful comment

There seems to be an issue with curl and api.github.com specifically.
My workaround was to change the host argument in devtools::install_github like the example below:

devtools::install_github("snowflakedb/dplyr-snowflakedb", host = "https://api.github.com")

All 10 comments

did you find a cause and fix for this?

Yes, thanks. The problems was that I didn't have curl properly set up in my path. It worked fine once I had corrected this.

How did you properly set up the path ? I am having the same problem but don't know how to fix it.

How did you properly set up the path ? I am having the same problem but don't know how to fix it.

Please see the link below. Good luck!
https://develop.zendesk.com/hc/en-us/articles/360001068567-Installing-and-using-cURL#install

There seems to be an issue with curl and api.github.com specifically.
My workaround was to change the host argument in devtools::install_github like the example below:

devtools::install_github("snowflakedb/dplyr-snowflakedb", host = "https://api.github.com")

@Maiae 's solution did not work for me, but what I realized is even though I was behind a corporate proxy, and I had export HTTP(S)_PROXY=xyz set, R did not understand it when it was capitalized. So what you want do is add export http(s)_proxy=xyz to your .basrc or wherever, source it, and then start R. Things should work with no issues after that.

I had the same issue on windows behind corp proxy.
Resolved by setting the http_proxy and https_proxy environment variables.

I had the same issue on windows behind corp proxy.
Resolved by setting the http_proxy and https_proxy environment variables.

Could you please explain what did you do in detail?

I had the same issue on windows behind corp proxy.
Resolved by setting the http_proxy and https_proxy environment variables.

Could you please explain what did you do in detail?

On Linux you would just put export http_proxy=xyz and export https_proxy=xyz (all lowercase) in yor shell startup file like your .bashrc and then source ~/.bashrc from your shell (there is no need for this step to be repeated as it will be automatically sourced on login.

On windows follow this guide https://www.tenforums.com/tutorials/121664-set-new-user-system-environment-variables-windows.html#option1. A GUI makes everything unnecessarily complicated.

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

Was this page helpful?
0 / 5 - 0 ratings