#Deno does not recognize ".node" extension files

1 messages · Page 1 of 1 (latest)

lethal shadow
#

[name].node is C++ (kind of) addons compiled for using in Node.JS (as i get it)

It just doesn't allow to run any code with it, since downloading npm:[email protected] with Deno, downloads everything EXCEPT index.node, but... default npm install rosu-pp does it, and runs very well, is there something I could do about it?

Reproducing problem can be done with this TypeScript + Deno chapter in this paste

I tried to run it with different(?) compilers, tsx, node and deno.

Trying to generate index.node by yourself doesn't help either, it throws an error require() is not defined 🥺

obtuse swallowBOT
#

I'm sorry for the inconvenience you're experiencing. However, based on the documentation, Deno does not support the use of Node.js C++ addons, which are typically files with the .node extension. These files are specific to Node.js and are not compatible with Deno's runtime.

Deno aims to provide a secure runtime for JavaScript and TypeScript, and it operates differently from Node.js. It does not support the require() function or the loading of native Node.js modules, which includes C++ addons.

While Deno provides some level of compatibility with Node.js through the use of built-in modules via node: specifiers and the ability to import npm packages using npm: specifiers, this does not extend to all Node.js features and modules.

If you're trying to use a package that relies on Node.js C++ addons, you might need to look for an alternative package that is compatible with Deno, or consider running your code in a Node.js environment instead. 🦕

#

🦕💚 I'm glad I was able to help!