“无效的ELF标头"当使用nodejs"ref"时AWS Lambda上的模块 [英] "invalid ELF header" when using the nodejs "ref" module on AWS Lambda

查看:283
本文介绍了“无效的ELF标头"当使用nodejs"ref"时AWS Lambda上的模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚将一个zip文件上传到AWS Lambda,其中包括"ref"( https://www .npmjs.com/package/ref ),这是验证iOS Game Center身份验证令牌(

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 (How to authenticate Game Center User from 3rd party node.js server).

不幸的是,调用它会导致无效的ELF标头"错误,

Unfortunately invoking it results in the "invalid ELF header" error,

{
  "errorMessage": "/var/task/node_modules/ref/build/Release/binding.node: invalid ELF header",
  "errorType": "Error",
  "stackTrace": [
    "Module.load (module.js:356:32)",
    "Function.Module._load (module.js:312:12)",
    "Module.require (module.js:364:17)",
    "require (module.js:380:17)",
    "bindings (/var/task/node_modules/ref/node_modules/bindings/bindings.js:76:44)",
    "Object.<anonymous> (/var/task/node_modules/ref/lib/ref.js:5:47)",
    "Module._compile (module.js:456:26)",
    "Object.Module._extensions..js (module.js:474:10)",
    "Module.load (module.js:356:32)",
    "Function.Module._load (module.js:312:12)"
  ]
}

这是在运行Yosemite的64位Macbook Pro上开发的,它在本地运行代码没有问题.到处搜寻无效的ELF标头"并没有产生多少相关结果,而且我真的不确定从这里去哪里.我最好在node.js区域中问这个问题,还是这个相关领域,因为这可能是平台的问题?

This has been developed on a 64bit Macbook Pro running Yosemite which has no problem running the code locally. Googling around for "invalid ELF header" has yielded little to know relevant results and I'm really not sure where to go from here. Would I be better asking this in a node.js area, or is this the relevant area, because it might be an issue with the platform?

推荐答案

当您在一种体系结构上构建,然后尝试在另一种体系结构(某些情况下为平台)上使用相同的内置插件时,就会发生这种情况.

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).

根据此页面,附加组件可能必须针对亚马逊进行编译为了使编译后的插件能够在其Lambda服务上使用,EC2上的Linux映像.

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.

这篇关于“无效的ELF标头"当使用nodejs"ref"时AWS Lambda上的模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆