Compilation of µWebSockets has failed
neobie opened this issue · 4 comments
neobie commented
Nothing works correctly, keep saying uWebSockets has failed
eiows.js:27
tried ubuntu, macos, v7 down to v4, nothing works.
mmdevries commented
This sounds like an issue related to the lack of build tools on the system. Can you copy/paste the content of the file build_log.txt stored within the node_modules/eiows directory?
pochun26 commented
Same issue but I tried in docker
I tried install some packages in image, but still the same error.
FROM node:22.2.0-bookworm-slim
RUN apt-get update && apt-get install -y \
git \
build-essential \
gcc
/app/node_modules/eiows/dist/eiows.js:27
throw new Error(e.toString() + '\n\nCompilation of µWebSockets has failed.' +
^
Error: Error: /app/node_modules/eiows/dist/eiows_v22.2.0.node: invalid ELF header
Compilation of µWebSockets has failed.Please install a supported C++17 compiler, git and/or update node and reinstall the module 'eiows'.
at /app/node_modules/eiows/dist/eiows.js:27:15
at Object.<anonymous> (/app/node_modules/eiows/dist/eiows.js:30:3)
at Module._compile (node:internal/modules/cjs/loader:1434:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1518:10)
at Module.load (node:internal/modules/cjs/loader:1249:32)
at Module._load (node:internal/modules/cjs/loader:1065:12)
at cjsLoader (node:internal/modules/esm/translators:318:15)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:258:7)
at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:475:24)
Node.js v22.2.0```
mmdevries commented
You probably build the docker container on a different OS than where you run the docker container. If you build the docker container on a linux platform you also need to run the container on a Linux platform.
1finedev commented
+1