groendahl
groendahl2mo ago

https://github.com/apache/pulsar-client-node - does it work in Deno?

I tried to include it as follows: import pulsarNode from "npm:pulsar-client"; console.log(pulsarNode); I get this error: error: Uncaught (in promise) Error: Cannot find module '/Users/dkJoGrPe/projects/lego/lmv-canteen/node_modules/.deno/pulsar-client@1.12.0/node_modules/pulsar-client/lib/binding/pulsar.node' info: Trying to execute an npm package using Node-API addons, these packages require local node_modules directory to be present. hint: Add "nodeModulesDir": "auto" option to deno.json, and then run deno install --allow-scripts=npm:<package> --entrypoint <script> to setup node_modules`directory. I have a local node_modules folder with the library already using option nodeModulesDir="auto" in deno.json The library has this note: This library works only in Node.js 12.3 or later because it uses: The node-addon-api module to wrap the C++ library. The Mozilla CA file, which is provided by Node.js v12.3.0 and subsequent versions. Does it work in Deno?
2 Replies
groendahl
groendahlOP2mo ago
Bump, anyone who have used pulsar?
bartlomieju
bartlomieju2mo ago
Did you install the package with --allow-scripts flag? It appears the native addon was not built/downloaded properly

Did you find this page helpful?