Node.js native module is not a valid Win32 application error

I dont know if it's too late, but I found the answer after some trial and error, mainly the problem (in my machine) was that I compiled the nodejs on windows to be able to create the extension using visual C++, and I already had installed the nodejs from the page, if I try to run the test using the default installation (which was added to my PATH by the nodejs installer) then it fails, but if I use the compiled node.exe (the one I compiled to be able to reference the libs in Visual C++) then it works.

In summary, the problem is not with the extension, it's with the nodejs compilation, use the node that you compiled (in order to build the VS solution I assume you did that) and then it should work on the remote machine.

Note: The problem relies on that you're using node.exe compiled in 64bits to run a 32bits dll, that's why it's complaining, if you use node.exe in 32 bits it should work. (at least that solved my problem)