运行Linux ubuntu 3.0.0-15-generic#26-Ubuntu SMP Fri 1月20日17:23:00 UTC 2012 x86_64 x86_64 x86_64 GNU / Linux
Node.js 0.6.9
多节点0.2.3
运行此代码(sudo node server.js):
var http = require("http");
http.createServer(function(request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.write("Hello World");
response.end();
});
var nodes = require("multi-node").listen({
port: 80,
nodes: 4
}, http);
我收到此错误:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: No such module
at Object.<anonymous> (/node_files/node_modules/multi-node/lib/multi-node.js:5:23)
at Module._compile (module.js:444:26)
at Object..js (module.js:462:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Module.require (module.js:357:17)
at require (module.js:373:17)
at Object.<anonymous> (/node_files/server.js:9:13)
at Module._compile (module.js:444:26)
at Object..js (module.js:462:10)
不确定如何记住这一点。非常感谢任何帮助。
答案 0 :(得分:2)
在multi-node.js错误跟踪器上存在此问题。看到 https://github.com/kriszyp/multi-node/issues/14
更新:结果是process.binding('net')
was removed介于0.4和0.6之间。这解释了您的错误消息。不幸的是,似乎没有解决方案。作为一种解决方法,也许您应该使用Node's cluster module(正如其中一位评论者所建议的那样)。
答案 1 :(得分:0)
$ rm / usr / bin / npm