2

我正在尝试在我的 Windows 10 PC 上为 Google Apps 脚本设置 Clasp。当我尝试通过命令行 ( clasp login) 登录时,会打开一个浏览器选项卡,让我登录到 google。之后,我被重定向到的网页显示身份验证成功;但是命令行显示:

Error retrieving access token: FetchError: request to https://oauth2.googleapis.com/token failed, reason: unable to verify the first certificate

有谁知道这可能是什么原因以及我该如何解决?

我不认为这是一个网络问题,因为我的树莓派和 mac 都通过了很好的身份验证。我尝试使用clasp login --no-localhost无济于事,更改网络浏览器似乎也无济于事。删除/重新安装节点和 npm 没有改变。

我还禁用了我的防火墙和实时扫描,什么都没有。

我所期待的:

C:\Users\User>clasp login

[...]

Authorization successful.

Default credentials saved to: ~/.clasprc.json (/home/pi/.clasprc.json).

我得到了什么:

C:\Users\User>clasp login

[...]

Error retrieving access token: FetchError: request to https://oauth2.googleapis.com/token failed, reason: unable to verify the first certificate
4

1 回答 1

0

我不确定这里的确切问题,但我认为这是使用 Node HTTP 请求的 Google API 的一般问题。

你能试试看这个解决方案是否有效吗?

https://github.com/request/request/issues/2061#issuecomment-182573171

此外,我在 GitHub 存储库上更加活跃,因此也考虑在那里提交问题: https ://github.com/google/clasp/issues/new

谢谢,格兰特

于 2019-07-31T01:47:48.310 回答