DenoDDeno
Powered by
groendahlG
Denoβ€’16mo agoβ€’
2 replies
groendahl

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);
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
node_modules
directory to be present.
hint: Add "nodeModulesDir": "auto" option to
deno.json
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?
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,944Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

How does importing `node:https` work?
abiAabi / help
3y ago
Does the deno-astro-adapter will be updated to use astro 4? https://github.com/denoland/deno-astro-a
fro.profesionalFfro.profesional / help
3y ago
HTTPS w/ client certificate – works in Node.js, not in Deno
abiAabi / help
3y ago
what rpc version is https://github.com/deno-libs/rpc?
datmetal1Ddatmetal1 / help
2y ago