Search code examples
node.jszeromqubuntu-20.04zeromq-js

Node application doesn't start with "zeromq.node: undefined symbol: sodium_init" message


Problem

Node application not starts with the following message:

node: symbol lookup error: /home/user/nodeapp/node_modules/zeromq/build/Release/zeromq.node: undefined symbol: sodium_init

Application uses ZeroMQ.js having the following in package.json:

  "dependencies": {
    "zeromq": "^6.0.0-beta.16"
  }

Starting application failed with above message. I'm running:

  • ubuntu 20.04.5 LTS
  • node v16.18.1
  • npm 8.19.2
  • libzmq3-dev (4.3.2-2ubuntu1)

Workaround

Application starts and run normally if I remove zeromq module and install it with the following command:

npm install zeromq@6.0.0-beta.16 --zmq-shared

But the next time when I run npm install the problem returns.

Question

Is it possible to not manually install ZeroMQ.js Version 6.0.0 in my environment to avoid application failure with undefined symbol message?

Unfortunately I can't upgrade Ubuntu and Node now due to system requirements.


Solution

  • I just created a PR for solving this bug: https://github.com/zeromq/zeromq.js/pull/553

    Hopefully should be merged and released soon. So upstep your zeromq npm-package after that.