在Nodejs中使用ZeroMQ消息传递时出现以下错误
Error: Module version mismatch. Expected 46, got 67.
at Error (native)
at Object.Module._extensions..node (module.js:435:18)
at Module.load (module.js:344:32)
at Function.Module._load (module.js:301:12)
at Module.require (module.js:354:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/home/Documents/HomeApp/node_python/node_modules/zeromq/lib/index.js:6:11)
这是nodejs服务器端的代码
app.get("/top", (req, res) => {
console.log("Here0");
res.sendFile(__dirname + "/index.html");
var zerorpc = require("zerorpc");
var client = new zerorpc.Client({ timeout: 3000, heartbeatInterval: 300000 });
console.log("Here");
client.connect("tcp://127.0.0.1:4242");
console.log("And Here");
client.invoke("hello", "World!", function(error, res, more) {
console.log(res);
if (error) {
console.error(error);
}
console.log(tlist);
res.send(tlist);
client.close();
});
节点-v = v4.2.6 npm -v = 6.4.1
尝试
“ rm -rf node_modules && npm install”仍然出现相同的错误
“ npm install zeromq --build-from-source”无效
我被挡在了这个位置。感谢任何帮助