0

I have lambda functions folder structure as

 ---root -functions ---node_nodules ---lib ---function1.js ---function2.js -function1.lambda -function2.lambda 

There are lot of functions and lot of lambda handler.

The file size of the functions folder is about 140mb due to node modules alone 138 MB. Though I was able to deploy the lambda function with

 lambda deploy function1.lambda. 

But suddenly following error started to appear.

 Error generating zip file /usr/local/lib/node_modules/aws-lambda/lib/main.js:82 throw err; ^ RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stdout maxBuffer length exceeded at Socket.onChildStdout (child_process.js:354:14) at Socket.emit (events.js:198:13) at Socket.EventEmitter.emit (domain.js:448:20) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:265:13) at Socket.Readable.push (_stream_readable.js:224:10) at Pipe.onStreamRead (internal/stream_base_commons.js:94:17) 

I tried searching for the fix, but i could not find any appropriate one. Can anyone help here ? Thanks in advance.

1 Answer 1

1

Let me suggest to take a small detour to get The Serverless Framework here installed and let it package & deploy your Lambda. For an example, refer here.

It is going to be way lot easier, as it manages packaging ZIPs, deploying to AWS including downloading latest NPM modules before packaging and cleaning up etc.

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you, I will definitely try and let you know.
Well, that's very handy package for developing a new server-less functions, but i have a lot of functions already, do you think its possible to shit from old way to this one ?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.