首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >放大无法推动auth - nodejs8.10 8.10

放大无法推动auth - nodejs8.10 8.10
EN

Stack Overflow用户
提问于 2020-02-10 20:06:06
回答 3查看 1.9K关注 0票数 1

我正试着用AWS放大器来设置auth。

代码语言:javascript
复制
$ npm install -g @aws-amplify/cli
$ amplify --version
Scanning for plugins...
Plugin scan successful
4.13.2

奥斯是通过运行

代码语言:javascript
复制
amplify init
amplify add auth
amplify push

但是,最后一个命令将失败。

代码语言:javascript
复制
Resource Name: UserPoolClientLambda (AWS::Lambda::Function)
Event Type: create
Reason: The runtime parameter of nodejs8.10 is no longer supported for creating or updating AWS Lambda functions. We recommend you use the new runtime (nodejs12.x) while creating or updating functions. (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: f6d965b6-e4a6-4a0e-a380-fc07ac950266)

检查创建的文件,我发现它确实使用nodejs8.10,但是这与放大文件冲突。我不认为手动编辑文件是一种解决方案,因为我不想将我自己的代码插入到放大器自动完成的操作中,并且可能会在某个时候被覆盖。

我错过了什么或者做错什么了吗?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2020-03-01 00:07:38

您的扩容CLI需要是v4.10.0或更高。重新运行安装以更新:

代码语言:javascript
复制
npm install -g @aws-amplify/cli

下次在代码库中运行amplify时,将建议更新节点运行时版本:

代码语言:javascript
复制
$ amplify --version
Scanning for plugins...
Plugin scan successful

Amplify CLI uses Lambda backed custom resources with CloudFormation to manage part of your backend resources.
In response to the Lambda Runtime support deprecation schedule
https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html
Nodejs runtime need to be updated from nodejs8.10  to nodejs10.x in the following template files:

[...]

Please test the changes in a test environment before pushing these changes to production. There might be a need to update your Lambda function source code due to the NodeJS runtime update. Please take a look at https://aws-amplify.github.io/docs/cli/lambda-node-version-update for more information

? Confirm to update the NodeJS runtime version to 10.x Yes

NodeJS runtime version updated successfully to 10.x in all the CloudFormation templates.
Make sure the template changes are pushed to the cloud by "amplify push"
4.13.4

参考资料:https://aws-amplify.github.io/docs/cli/lambda-node-version-update

根据策略,AWS在2020年1月6日放弃了Node.js运行时Node.js 8.10。 放大器CLI代码库已经更新以反映这一更改。在为您创建的Lambda函数中,用Node.js 10代替Node.js 8.10。如果您使用Amplify CLIVersion4.10.0及更高版本来创建新的aws资源,这与您无关。

票数 4
EN

Stack Overflow用户

发布于 2020-11-04 17:28:08

嗨,我刚修好这个,我相信!您需要做的是转到后端/Auth/目录,并找到您的*.yaml文件

从那里搜索AWS::Lambda::Function,并将运行时环境更改为nodejs12.x

不知道为什么默认是节点8。我在这么多的圆圈中运行试图找出这一点。

票数 3
EN

Stack Overflow用户

发布于 2020-07-29 21:46:48

的根本原因:

  • 旧放大版本(HA4.5试图部署节点8 lambda模板)

解决方案:

代码语言:javascript
复制
1) npm install -g @aws-amplify/cli
2) After install click "Y" on request to update template to Node 10
3) amplify push
票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/60157632

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档