问题
I am trying to use the serverless framework from behind a proxy.
I was able to install the framework after configuring npm to use my certs file:
npm config set cafile C:\path\to\certs.pem
npm install serverless --global
However, when I try to login to serverless I get the following error:
serverless login
Fetch Error --------------------------------------------
FetchError: request to https://api.serverless.com/core/tokens failed, reason: unable to get local issuer certificate at ClientRequest. (D:\...\npm\node_modules\serverless\node_modules\node-fetc h\index.js:133:11)
How do I set the certs file to be able to login to serverless?
Thank you in advance for your consideration and response.
回答1:
The cafile environment variable must be set before invoking login. On windows powershell:
$env:cafile = "C:\path\to\certs.pem"
来源:https://stackoverflow.com/questions/57758234/serverless-framework-login-from-behind-a-proxy