Skip to content

Addon fails to load on Ubuntu 22.04 due to musl-linked binary (libc.musl-x86_64.so.1 not found) #715

@Dr-klo

Description

@Dr-klo

Describe the bug

The ZeroMQ.js native addon fails to load on Ubuntu 22.04 with Node.js 18.20.7.
It tries to load a prebuilt binary linked against musl (libc.musl-x86_64.so.1), which is unavailable on glibc-based systems like Ubuntu.

Reproducing

Steps to reproduce:

  1. On Ubuntu 22.04 with Node.js 18.20.7:
  2. Install zeromq v6.4.0 via npm install zeromq
  3. Run a Node.js project with a simple import of zeromq
  4. The following error appears:
Failed to load addon at /root/myproject/node_modules/zeromq/build/linux/x64/node/127/addon.node: 
Error: libc.musl-x86_64.so.1: cannot open shared object file: No such file or directory

I attempted a workaround by installing musl and symlinking:

apt install musl-dev
ln -s /usr/lib/x86_64-linux-musl/libc.so /lib/libc.musl-x86_64.so.1

This leads to a different error:

Error: addon.node: undefined symbol: __cxa_call_terminate

Expected behavior

ZeroMQ.js should either:

  • Provide a prebuilt binary linked against glibc for Linux,
  • Or fall back to source build during npm install if no compatible binary is found.

Tested on

  • OS: Ubuntu 22.04
  • Node.js: 18.20.7
  • ZeroMQ.js version: 6.4.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions