当使用tunnel-ssh时,'TypeError:Object不是函数'

我正在运行stream行的NPM软件包tunnel-ssh的教程中的基本示例。 这里是代码:

var tunnel = require('tunnel-ssh'); var config = { username:'root', password:'secret', host:'remote.mysql.server.com', port:3306 } tunnel(config, function(e, sshTunnel){ //Now, you should be able to connect to the tunnel via localhost:3336. }); 

当然,我使用自己的数据库的凭据来运行它。 不过,我运行时总是遇到这个错误:

 TypeError: object is not a function 

有人知道发生了什么事?

 var tunnel = require('tunnel-ssh'); var config = {username: 'vagrant',host: '192.168.33.2', port:3307, dstPort:3306 } tunnel.tunnel(config, function(e, sshTunnel){}); 

我在192.168.33.2添加了我的密钥,并将目标端口3306转发到本地端口3307。

我在RPEL节点版本v0.12.4上运行这个。 它的工作。