0rpc / zerorpc-node

zerorpc for node.js
http://www.zerorpc.io
Other
704 stars 166 forks source link

A dynamic link library (DLL) initialization routine failed. #99

Open Rehoni opened 6 years ago

Rehoni commented 6 years ago

When i using zerorpc in my electron app, it throws an Exception:

"Error: A dynamic link library (DLL) initialization routine failed.\\?\f:GithubDIPelectronUI\node_moduleszmq\buildReleasezmq.node    
at process.module.(anonymous function) [as dlopen] (ELECTRON_ASAR.js:172:20)    
at Object.Module._extensions..node (module.js:671:18)    
at Object.module.(anonymous function) [as .node] (ELECTRON_ASAR.js:172:20)    
at Module.load (module.js:561:32)    
at tryModuleLoad (module.js:504:12)    
at Function.Module._load (module.js:496:3)    
at Module.require (module.js:586:17)   
at require (internal/module.js:11:18)    
at bindings (f:GithubDIPelectronUI\node_modules\bindings\bindings.js:76:44)    
at Object.<anonymous> (f:GithubDIPelectronUI\node_moduleszmqlibindex.js:6:30)"

My computer path, (and i'm using vscode to develop and debug my electron apps): node@v8.11.2 npm@v5.6.0 electron@v2.0.2 python@3.6.4 windows@10 Enterprise visual studio@2017

I think the reason may be this. image

There throws a lot of warning about the process of node-gyp compiling the ZeroMQ lib, and i guess if i solved these warnings, the DDL Error would be solved also?

And i'll appreciate if there got another solution for this DDL Error! (:з)∠)

crifan commented 4 years ago

Reason: node\_modules\\zerorpc\\node\_modules\\zeromq\\lib\\index.js

var EventEmitter = require('events').EventEmitter
  , zmq = require('../build/Release/zmq.node')
  , util = require('util');

this line:

zmq = require('../build/Release/zmq.node')

support: Linux/Mac not support: Win

Solution: Change node\_modules\\zerorpc\\node\_modules\\zeromq\\lib\\index.js from

var EventEmitter = require('events').EventEmitter
  , zmq = require('../build/Release/zmq.node')
  , util = require('util');

to:

var EventEmitter = require('events').EventEmitter

let path = require('path')
let zmqNodePath = path.join("..", "build", "Release", "zmq.node")
var zmq = require(zmqNodePath)

var util = require('util')

can support Linux/Mac/Win, and could find the zmq.node dll lib file.

detailed info please refer my Chinese post: 【已解决】windows中启动Electron-python报错:Uncaught Error A dynamic link library DLL initialization routine failed zerorpc  zeromq zmq.node