I had a problem getting the node module to load into AWS Lambda using the Serverless Framework. One of my node packages uses its own libraries, so I used EC2 to create the node_module folders, and then copied them to my project without a server. Everything works if I manually archive the project and upload it to AWS Lambda, but if I use it serverless deploywithout the specified artifact, I get an error in the module (in particular: ELF file phentsize not the expected sizeregarding the .node file)
I tried to add excludeDevDependencies: false, which makes the deployment larger, but still gives me an error. Currently, it only works if I zipped up the contents of the project folder and specified this file as an artifact for download. Is there any other way to get a node module with built-in connections for serverless deployment?
UPDATE: after disabling dev dependency exclusion, packaging using serverless packageand examining the serverless extended zip file creates, I found that the sizes of the .o and .a files are different in the packed version compared to the original. This is normal?

source
share