serverless.yml中的运行时变量未设置节点版本

时间:2019-07-03 22:30:35

标签: node.js amazon-web-services serverless

我正在aws上运行lambda函数,并使用Serverless进行部署。将节点从6.10更新到10.16,我用n更新了nodejs,并将serverless.yml文件中的“运行时”行更改为:

provider:
  name: aws
  runtime: nodejs10.16
  stage: prod
  region: us-west-2

当我使用无服务器进行部署时,收到以下消息:

Serverless Error ---------------------------------------

  An error occurred: GetLaunchEventListLambdaFunction - The runtime 
parameter of nodejs6.10 is no longer supported for creating or updating 
AWS Lambda functions. We recommend you use the new runtime 
(nodejs10.x) while creating or updating functions. (Service: 
AWSLambdaInternal; >Status code: 400; Error Code: 
InvalidParameterValueException; Request >ID: abc26ccc-9289-431f-abd6- 
61a73bdb4c2e).

  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com

  Your Environment Information -----------------------------
     OS:                     linux
     Node Version:           6.10.3
     Serverless Version:     1.27.3

我想念什么?

1 个答案:

答案 0 :(得分:1)

正确的语法应该是<script type="text/javascript"> window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s= d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set. _.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute("charset","utf-8");$.setAttribute("defer",null); $.src="https://v2.zopim.com/?2dAdkKRoqdi9hHHrfr302XabQaK8DN7f";z.t=+new Date;$. type="text/javascript";e.parentNode.insertBefore($,e)})(document,"script"); </script> ,但我来到这里是因为即使使用(我认为是)正确的语法,我也会遇到相同的问题。