I'm having an issue getting a node module to load in AWS Lambda using the Serverless Framework. One of my node packages uses native libraries so I used an EC2 to create the node\_module folders and then copied them to my Serverless project. Everything works if I manually zip the project and upload to AWS Lambda but if I use `serverless deploy` without an artifact specified, I get an error about the module (specifically: `ELF file's phentsize not the expected size` regarding a .node file)

I've tried adding `excludeDevDependencies: false` which makes the deployment larger but still gives me the error. Currently, it only works if I zip the contents of the project folder and specify that file as the artifact to upload. Is there a different way to get a node module with native bindings to deploy with Serverless?

UPDATE: After turning off the exclusion of dev dependencies, packaging using `serverless package` and examining the expanded zip file serverless creates, I discovered the file sizes of the .o and .a files are different in the packaged version as compared to the original. Is this normal?

[![enter image description here](https://i.stack.imgur.com/aaDGe.png)](https://i.stack.imgur.com/aaDGe.png)