“invalid ELF header” when using the nodejs “ref” module on AWS Lambda

前端 未结 2 1975
一生所求
一生所求 2020-12-01 16:11

I\'ve just uploaded a zip to AWS Lambda which included the \"ref\" (https://www.npmjs.com/package/ref), which is needed to validate an iOS Game Center authentication token (

相关标签:
2条回答
  • 2020-12-01 16:18

    This happens when you build on one architecture and then attempt to use the same built addon on a different architecture (or platform in some cases).

    According to this page, addons may have to be compiled against an Amazon Linux image on EC2 in order for the compiled addons to be usable on their Lambda service.

    0 讨论(0)
  • 2020-12-01 16:23

    This doesn't apply exactly to your question, but in case anyone stumbles across this when using AWS Elastic Beanstalk, it could be a result of uploading the node_modules/ directory along with everything else, so you need to force it to ignore the file.

    .ebignore

    node_modules/
    
    0 讨论(0)
提交回复
热议问题