我正在尝试在 ubuntu 上安装 Node js 客户端的 pulsar-client。我收到以下错误:
fatal error: pulsar/c/message.h: No such file or directory #include <pulsar/c/message.h>
compilation terminated.
Pulsar.target.mk:116: recipe for target 'Release/obj.target/Pulsar/src/addon.o' failed
make: *** [Release/obj.target/Pulsar/src/addon.o] Error 1
文档说
Pulsar Node.js client library is based on the C++ client library. Follow the instructions for C++ library for installing the binaries through RPM, Deb or Homebrew packages.
(Note: you will need to install not only the pulsar-client library but also the pulsar-client-dev library)
但是,在 Ubuntu 上安装 C++ 库的说明不是很清楚。目前还不清楚如何安装 pulsar-client-dev 库。
最佳答案
你是对的,必须安装 C++ 库。需要注意的是,请确保安装了兼容的 C++ 库。 https://github.com/apache/pulsar-client-node#compatibility
要在 ubuntu 上安装 C++ 库,这里是一个来 self 们基于 Ubuntu 构建的 Docker 镜像的示例。 https://github.com/kafkaesque-io/pulsar-beam/blob/master/Dockerfile#L29
wget --user-agent=Mozilla -O apache-pulsar-client.deb "https://archive.apache.org/dist/pulsar/pulsar-2.4.1/DEB/apache-pulsar-client.deb"
wget --user-agent=Mozilla -O apache-pulsar-client-dev.deb "https://archive.apache.org/dist/pulsar/pulsar-2.4.1/DEB/apache-pulsar-client-dev.deb"
apt install -y ./apache-pulsar-client.deb
apt install -y ./apache-pulsar-client-dev.deb
关于c++ - 在ubuntu上安装node js pulsar客户端,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59894670/