問題描述
從代理後面登錄的無服務器框架? (Serverless Framework Login From Behind a Proxy?)
我正在嘗試從代理後面使用 無服務器框架。
在配置 npm
以使用我的證書文件後,我能夠安裝框架:
npm config set cafile C:\path\to\certs.pem
npm install serverless ‑‑global
但是,當我嘗試登錄無服務器時,我得到了以下錯誤:
serverless login
Fetch Error ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑ ‑‑‑‑‑‑‑‑‑‑‑‑‑
FetchError: 請求 https://api.serverless.com/core/tokens 失敗,原因:無法在 ClientRequest 獲取本地頒發者證書。(D:\...
參考解法
方法 1:
The
cafile
environment variable must be set before invokinglogin
. On windows powershell:$env:cafile = "C:\path\to\certs.pem"
(by Ramón J Romero y Vigil、Ramón J Romero y Vigil)
參考文件