Search code examples
windowsnode.jsnode-gyp

node-expat compiled on windows but module not found


https://github.com/TooTallNate/node-expat/tree/gyp and node-gyp were used to compile it. node_expat.node was generated. I get the follow error when reference in code:

module.js:485
  process.dlopen(filename, module.exports);
          ^
Error: The specified module could not be found.
C:\Users\s\Desktop\Translink\TooTallNate-node-expat-e7d7cb5\build\Releas
\node_expat.node
    at Object.Module._extensions..node (module.js:485:11)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (C:\Users\s\Desktop\Translink\server.js:1:181)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.runMain (module.js:492:10)

I couldn't get further trying to get node-expat on windows. Appreciate any inputs.


Solution

  • It needs the libexpat.dll as .node is actually a dynamic linked library. I copied the libexpat.dll in to the Release directory to make it work. It could be copied into system32 as well.