how do i fix this node_dlang error?
Mike Parker
aldacron at gmail.com
Sun Jun 6 06:10:18 UTC 2021
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.
More information about the Digitalmars-d-learn
mailing list