gpt4 book ai didi

amazon-web-services - 解压后的大小必须小于 262144000 字节 - AWS Lambda 错误

转载 作者:行者123 更新时间:2023-12-03 20:26:41 26 4
gpt4 key购买 nike

我曾尝试使用 servless/lambda 函数 AWS 上传我的应用程序,但我遇到了这个问题:

An error occurred: AppLambdaFunction - Unzipped size must be smaller than 262144000 bytes (Service: AWSLambdaInternal; Status Code: 400; Error Code: InvalidParameterValueException; Request ID: 8ea0d887-5743-4db1-96cd-6c5efa57b081).



解决它的最佳方法是什么?

看看我的依赖:
  "dependencies": {
"ethereumjs-tx": "^1.3.7",
"aws-sdk": "^2.4.52",
"body-parser": "^1.18.3",
"compression": "^1.7.4",
"consign": "^0.1.6",
"cors": "^2.8.5",
"express": "^4.16.4",
"helmet": "^3.16.0",
"moment": "^2.24.0",
"openzeppelin-solidity": "^2.3.0",
"serverless": "^1.48.2",
"serverless-http": "^1.9.1",
"serverless-offline": "^4.9.4",
"truffle": "^5.1.9",
"truffle-hdwallet-provider": "^1.0.17",
"web3": "^1.2.5-rc.0"
},

无服务器.yml:
provider:
name: aws
runtime: nodejs8.10
stage: v1
region: us-east-1
timeout: 30
memorySize: 512
package:
excludeDevDependencies: true
exclude:
- .git/**
- .vscode/**
- venv/**

functions:
app:
handler: handler.run
events:
- http:
path: /
method: ANY
cors: true
- http:
path: /{proxy+}
method: ANY
cors: true

plugins:
- serverless-offline

最佳答案

使用指令 exclude在您的 serverless.yml 文件中。在 Python 的情况下,我已经按如下方式使用它:

package:
exclude:
- node_modules/**
- venv/**
构建过程会将它们从构建中排除,然后再发送到 AWS。
我收到的提示 in this issue at Github .该指令的文档是 detailed here .

关于amazon-web-services - 解压后的大小必须小于 262144000 字节 - AWS Lambda 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59931761/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com