Server without NodeJS server / Native node_modules

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?

enter image description here

+4
source share
2 answers

Lambda Linux, serverless deploy Linux-.

, , Linux.

, serverless, sls package sls deploy --noDeploy ( ) .serverless, . zip , .

, ( , ), , - / serverless.yml.

0

Source: https://habr.com/ru/post/1684791/


All Articles