Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find ZSTD library on Mac M1 machine #1062

Open
Sumu-Ning opened this issue Dec 7, 2023 · 1 comment
Open

Cannot find ZSTD library on Mac M1 machine #1062

Sumu-Ning opened this issue Dec 7, 2023 · 1 comment

Comments

@Sumu-Ning
Copy link

Environment Information

  • OS [Mac 13.6.2]:
  • Node Version [18.19.0]:
  • NPM Version [10.2.3]:
  • C++ Toolchain [e.g. Visual Studio, llvm, g++]:
  • node-rdkafka version [2.13.0]:

Steps to Reproduce
Initialize Kafka producer using zstd codec

    const producer = new Producer({
        'compression.codec': 'zstd',
        ...
    });

Running the Node js application, and got the following error

[server] ERROR 2023-12-07T05:02:58.908Z [src/index.ts] App has failed to startError: Unsupported value "zstd" for configuration property "compression.codec": libzstd not available at build time
[server] Error: Unsupported value "zstd" for configuration property "compression.codec": libzstd not available at build time

node-rdkafka Configuration Settings
No customization

Additional context

  • ZSTD installed on my machine using homebrew, and zstd library and include can be found at /opt/homebrew/lib and /opt/homebrew/include, respectively
  • I tried to rebuild RD kafka using npm rebuild node-rdkafka, but it does not help
@midnightcodr
Copy link

For me this works:

CPPFLAGS="-I/usr/local/opt/zstd/include" LDFLAGS='-L/usr/local/opt/zstd/lib' npm rebuild node-rdkafka

the paths in my env are different, you might want to adjust accordingly, If these directories /opt/homebrew/lib/zstd and /opt/homebrew/include/zstd exist in your system. try

CPPFLAGS="-I/opt/homebrew/include/zstd" LDFLAGS='-L/opt/homebrew/lib/zstd' npm rebuild node-rdkafka

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants