我正在尝试在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

该文件说



但是,在Ubuntu上安装C++库的说明不是很清楚。还不清楚如何安装pulsar-client-dev库。

最佳答案

正确,必须安装C++库。请注意,请确保已安装兼容的C++库。
https://github.com/apache/pulsar-client-node#compatibility

要安装C++库ubuntu,下面是一个示例,该示例来自我们基于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

10-06 12:08