This message was deleted.
# general
s
This message was deleted.
w
More or less yes - your local
node_modules
is uploaded as part of the Lambda. That does mean that if you are using native Node modules, you’ll need to install Node modules in a sufficiently compatible Linux environment - ideally an Amazon Linux docker image.
j
Hmmm that sucks I've already tried with the official lambda build container and still can't get the module to load correctly
Will keep poking around
w
Curious - what error do you see?
j
It always ends up with:
Copy code
module initialization error: Error
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/var/task/node_modules/sharp/lib/constructor.js:10:15)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
Which from the googling I've done seems typical of situations where an incompatible version of sharp is trying to be loaded into the Lambda environment 😞
w
Cc @lemon-spoon-91807 in case he has any additional thoughts.
l
that's definitely tricky. one possibility i can think of (not knowing node super-well) would be that it might be possible if you could somehow install both versions of "sharp" locally, then explicitly pass arguments to Lambda creation to skip the package relevant to your local env, and upload the package relevant to the foreign env.