NodeLoad模块给出错误:对象#<client>没有方法'destroy'</client>

时间:2015-04-10 05:30:47

标签: node.js request nodeload

我正在使用nodejs的NodeLoad模块同时发送多个请求来测试服务器节点应用程序,但是如果我使用numUsers : 50而不是它完全适合我。当我采用numUsers : 300而不是给我错误时:TypeError: Object #<Client> has no method 'destroy'

我使用的NodeLoad App

timeLimit: 10,
targetRps: 5,
numUsers : 300,

错误:

},reconnect=function(){var oldclient=client;if(oldclient){oldclient.destroy();
                                                                ^
TypeError: Object #<Client> has no method 'destroy'
at reconnect (/root/nodeLoadDemo/nodeload/node_modules/nodeload/nodeload.js:9:506)
at Client.<anonymous> (/root/nodeLoadDemo/nodeload/node_modules/nodeload/nodeload.js:10:180)
at Client.EventEmitter.emit (events.js:117:20)
at ClientRequest.<anonymous> (http.js:2144:10)
at ClientRequest.EventEmitter.emit (events.js:95:17)
at Socket.socketOnEnd [as onend] (http.js:1568:9)
at Socket.g (events.js:180:16)
at Socket.EventEmitter.emit (events.js:117:20)
at _stream_readable.js:919:16
at process._tickCallback (node.js:419:13)

那么,任何人都可以解释我的错误吗?并解决这些错误?

谢谢。

1 个答案:

答案 0 :(得分:0)

我得到了答案

Click Here To go on Solution

您只需要更改node modules。打开nodeload个模块和nodeload.js文件检查第9行句末replace

if (oldclient) { oldclient.destroy(); }

if (oldclient && oldclient.destroy) { oldclient.destroy(); }