Open mkscastillo opened 2 years ago
getting similar error when running it on Azure Function with Linux OS with Node 16
Result: Failure Exception: Error: /home/site/wwwroot/node_modules/node-rdkafka/build/Release/node-librdkafka.node: invalid ELF header Stack: Error: /home/site/wwwroot/node_modules/node-rdkafka/build/Release/node-librdkafka.node: invalid ELF header at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183: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 bindings (/home/site/wwwroot/node_modules/bindings/bindings.js:112:48) at Object.<anonymous> (/home/site/wwwroot/node_modules/node-rdkafka/librdkafka.js:10:32) at Module._compile (node:internal/modules/cjs/loader:1101:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) at Module.load (node:internal/modules/cjs/loader:981:32)
node-rdkafka is binding against a C library which must be compiled against the architecture that is going to run on. Is it possible that you copied your local node_modules directory to Azure Function runtime?
agree with IAlex97 -- I have seen this error when my nvm version is not in sync with what the project is compiled against; the binaries need to match the version you are compiling with. ensure you are using the same node version before running npm install.
Environment Information
Steps to Reproduce Getting this error when trying to start kafka feed
Additional context
Also checked for: