0
votes

I am writing code to load c++ dll from electron. My dll is 32 bit. I am using NaN and bindings to achieve this. I used the following commands to set build for 32 bit:

node-gyp clean configure build --verbose --arch=ia32 
npm set npm_config_arch ia32
npm install --arch=ia32 electron-prebuilt -g

When I run npm install I get the following error:

fatal error LNK1112: module machine type 'X86' conflicts with target machine type 'x64'

Although I am able to build and run my module with the following command:

electron-rebuild -f -w yourmodule --arch=ia32

But I am wondering why npm install fails.

1
What you've posted is a warning, not an error...andreee
Sorry I added line from wrong project. Added correct error statementNikhil

1 Answers

0
votes

The below works for me

npm set npm_config_arch ia32
npm clean-install --arch=ia32

The first command set the node environment to 32bit. The second command re-install all the node packages that are 32bit compatible.