On Sunday, 6 June 2021 at 06:10:18 UTC, Mike Parker wrote:
On Sunday, 6 June 2021 at 04:25:39 UTC, Jack wrote:
I'm trying to use the node_dlang pakckage but the code example from [this repo](https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples) isn't working

the command ```dub build``` is fine but ```node example.js``` retuns an error saying the module.node is not a valid win32 application. How do I fix this?

[1]: https://github.com/NotSpooky/node_dlang/tree/v0.4.11/examples

Looking at node_dlang's dub.json, it's building a DLL then renaming it to module.node. The JS script then causes node to load the DLL.

So I expect this error may be related to a 32-bit vs. 64-bit issue. I assume you are on 64-bit Windows, in which case recent versions of dub compile as 64-bit by default. So if that's the case, and your installation of node is 32-bit, you would see this error. Ditto when you're loading a 32-bit DLL in a 64-bit process.

that's right, I was on 64bit system and node was 32bit installation (I didn't even realize I installed the 32bit instead of 64bit). I just installed node 64bit version, that fixed, thanks!

Reply via email to