1

如何使用serverless plugin list代理后面的命令?
我收到此错误:

request to https://raw.githubusercontent.com/serverless/plugins/master/plugins.json failed, reason: connect ECONNREFUSED 151.101.84.133:443

该命令serverless deploy适用于我的代理,因此代理和/或代理配置应该不是问题。

版本

$ node --version
v11.1.0

$ npm --version
6.4.1

环境变量

$ env | grep -i proxy
NO_PROXY=localhost,127.0.0.0/8,::1
http_proxy=http://localhost:3128/
npm_config_https_proxy=http://localhost:3128/
https_proxy=http://localhost:3128/
no_proxy=localhost,127.0.0.0/8,::1
npm_config_proxy=http://localhost:3128/

卷曲

即使我curl这样做,它也适用于我的代理设置。为简洁起见截断。

$ curl --verbose https://raw.githubusercontent.com/serverless/plugins/master/plugins.json
*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 3128 (#0)
* Establish HTTP proxy tunnel to raw.githubusercontent.com:443
> CONNECT raw.githubusercontent.com:443 HTTP/1.1
> Host: raw.githubusercontent.com:443
> User-Agent: curl/7.47.0
> Proxy-Connection: Keep-Alive
> 
< HTTP/1.1 200 Connection established
< Connection: close
< 
* Proxy replied OK to CONNECT request
* found 155 certificates in /etc/ssl/certs/ca-certificates.crt
* found 625 certificates in /etc/ssl/certs
* ALPN, offering http/1.1
* SSL connection using TLS1.2 / ECDHE_RSA_AES_128_GCM_SHA256
*    server certificate verification OK
*    server certificate status verification SKIPPED
*    common name: www.github.com (matched)
*    server certificate expiration date OK
*    server certificate activation date OK
*    certificate public key: RSA
*    certificate version: #3
*    subject: C=US,ST=California,L=San Francisco,O=GitHub\, Inc.,CN=www.github.com
*    start date: Thu, 23 Mar 2017 00:00:00 GMT
*    expire date: Wed, 13 May 2020 12:00:00 GMT
*    issuer: C=US,O=DigiCert Inc,OU=www.digicert.com,CN=DigiCert SHA2 High Assurance Server CA
*    compression: NULL
* ALPN, server accepted to use http/1.1
> GET /serverless/plugins/master/plugins.json HTTP/1.1
> Host: raw.githubusercontent.com
> User-Agent: curl/7.47.0
> Accept: */*
> 
< HTTP/1.1 200 OK
< Content-Security-Policy: default-src 'none'; style-src 'unsafe-inline'; sandbox
< Strict-Transport-Security: max-age=31536000
< X-Content-Type-Options: nosniff
< X-Frame-Options: deny
< X-XSS-Protection: 1; mode=block
< ETag: "53374f2ed929f6d42faf13ebb025e0ff985941f1"
< Content-Type: text/plain; charset=utf-8
< Cache-Control: max-age=300
< X-Geo-Block-List:
< X-GitHub-Request-Id: 447E:6762:1CABB8:1E679B:5BEAD6AF
< Content-Length: 45355
< Accept-Ranges: bytes
< Date: Tue, 13 Nov 2018 13:50:39 GMT
< Via: 1.1 varnish
< Connection: keep-alive
< X-Served-By: cache-bma1635-BMA
< X-Cache: MISS
< X-Cache-Hits: 0
< X-Timer: S1542117040.576321,VS0,VE107
< Vary: Authorization,Accept-Encoding
< Access-Control-Allow-Origin: *
< X-Fastly-Request-ID: 929450c7326d8ce7c7ffa13174cbd80c86ecc255
< Expires: Tue, 13 Nov 2018 13:55:39 GMT
< Source-Age: 0
< 
[
4

1 回答 1

0

serverless plugin根据此问题,这被确定为一个错误:
https ://github.com/serverless/serverless/issues/5480

解决方案将来自此 PR:
https ://github.com/serverless/serverless/pull/5481

serverless pluginsimple 不支持proxy到这个版本。

于 2018-11-14T12:40:45.890 回答