mmmagic icon indicating copy to clipboard operation
mmmagic copied to clipboard

Lambda AWS issue

Open hectorprats opened this issue 5 years ago • 5 comments

With nodejs10.x in lambda AWS

const Magic = require('mmmagic')

{ "errorType": "Error", "errorMessage": "libnode.so.64: cannot open shared object file: No such file or directory", "trace": [ "Error: libnode.so.64: cannot open shared object file: No such file or directory", " at Object.Module._extensions..node (internal/modules/cjs/loader.js:807:18)", " at Module.load (internal/modules/cjs/loader.js:653:32)", " at tryModuleLoad (internal/modules/cjs/loader.js:593:12)", " at Function.Module._load (internal/modules/cjs/loader.js:585:3)", " at Module.require (internal/modules/cjs/loader.js:692:17)", " at require (internal/modules/cjs/helpers.js:25:18)", " at Object. (/opt/nodejs/node_modules/mmmagic/lib/index.js:1:13)", " at Module._compile (internal/modules/cjs/loader.js:778:30)", " at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)", " at Module.load (internal/modules/cjs/loader.js:653:32)" ] }

hectorprats avatar Aug 17 '20 02:08 hectorprats

That's a problem with the node installation, not mmmagic.

mscdex avatar Aug 17 '20 04:08 mscdex

It happens only with this library

hectorprats avatar Aug 17 '20 05:08 hectorprats

I don't have anything to suggest as I don't use Lambda. mmmagic builds and executes just fine on normal *nix and Windows though.

mscdex avatar Aug 17 '20 05:08 mscdex

@hectorprats This should be an issue or question for AWS Lambda on how to fix:

Error: libnode.so.64: cannot open shared object file: No such file or directory"

elitan avatar Jul 14 '21 09:07 elitan

To make it work for lambda, you MUST install (and implicitly compile) it for the right version of your runtime. It is different from your local machine. To do so you can use for example this docker image: https://hub.docker.com/_/amazonlinux .

Because this issue is very old, it, probably, can be closed.

Bessonov avatar Dec 07 '22 00:12 Bessonov