0

I am trying to deploy my NestJS application to AWS Lambda.

Everything is working fine locally with sls offline command but the problem occours when I deploy it and call the public URL.

When I looked at my cloudwatch logs, I am getting this error:

2022-08-31T09:07:25.867Z    undefined   ERROR   Uncaught Exception  {
    "errorType": "Error",
    "errorMessage": "/lib64/libm.so.6: version `GLIBC_2.29' not found (required by /var/task/node_modules/sweph/build/Release/sweph.node)",
    "code": "ERR_DLOPEN_FAILED",
    "stack": [
        "Error: /lib64/libm.so.6: version `GLIBC_2.29' not found (required by /var/task/node_modules/sweph/build/Release/sweph.node)",
        "    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1189:18)",
        "    at Module.load (node:internal/modules/cjs/loader:981:32)",
        "    at Function.Module._load (node:internal/modules/cjs/loader:822:12)",
        "    at Module.require (node:internal/modules/cjs/loader:1005:19)",
        "    at require (node:internal/modules/cjs/helpers:102:18)",
        "    at Object.<anonymous> (/var/task/node_modules/sweph/index.js:3:15)",
        "    at Module._compile (node:internal/modules/cjs/loader:1105:14)",
        "    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1159:10)",
        "    at Module.load (node:internal/modules/cjs/loader:981:32)",
        "    at Function.Module._load (node:internal/modules/cjs/loader:822:12)"
    ]
}
bizprat
  • 11
  • 2
  • @Joe It seems it can solve the problem, but I don't know how to use it. The error is with 3rd party npm module, which is already using the same solution. Can you please help me solving it? I am using this [sweph](https://github.com/timotejroiko/sweph) module. – bizprat Aug 31 '22 at 15:03
  • you need to build all your node modules on the platform it's going to be deployed in. the ones that have native compilation won't easily transfer from one environment to another unless they are very close – Joe Aug 31 '22 at 15:21

0 Answers0