R安装github包报错解决
·
Using github PAT from envvar GITHUB_PAT. Use `gitcreds::gitcreds_set()` and unset GITHUB_PAT in .Renviron (or elsewhere) if you want to use the more secure git credential store instead.
错误: Failed to install 'unknown package' from GitHub:
HTTP error 401.
Bad credentials
Rate limit remaining: 57/60
Rate limit reset at: 2025-05-23 09:51:59 UTC
有时网络条件不好时就会出现这个。
解决方案如下
#R中输入这个,并在弹出页面中登录自己的github,生成自己的token
usethis::create_github_token()
#将自己的token替换R中的token
Sys.setenv(GITHUB_PAT = "你的token")
#然后按照先前的下载就OK啦,当然不放心可以看看到底替换好没
Sys.getenv("GITHUB_PAT")
更多推荐

所有评论(0)