2016-06-21 58 views
0

我試圖在IBM MQ推送消息,我現在用的節點JS:如何在IBM MQ推消息通過節點JS

我安裝npm install [email protected]

的代碼是:

var mqlight = require('mqlight'); 
var recvClient = mqlight.createClient({service: 'amqp://localhost'}); 
recvClient.on('started', function() { 
recvClient.subscribe('NodeQueue'); 
recvClient.on('message', function(data, delivery) { 
      console.log(data); 
    }); 
}); 


var mqlight = require('mqlight'); 
var sendClient = mqlight.createClient({service: 'amqp://localhost'}); 
sendClient.on('started', function() { 
    sendClient.send('NodeQueue', 'Hello Node Queue!'); 
}); 

,但我得到以下錯誤:

Error: mqlight.js is not currently supported on node-v48-win32-x64 
    at Object.<anonymous> (C:\Users\cdeshma2\node_modules\mqlight\mqlight.js:65: 
13) 
    at Module._compile (module.js:541:32) 
    at Object.Module._extensions..js (module.js:550:10) 
    at Module.load (module.js:458:32) 
    at tryModuleLoad (module.js:417:12) 
    at Function.Module._load (module.js:409:3) 
    at Module.require (module.js:468:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (C:\Users\cdeshma2\Desktop\TestWorkSpace\Test\Queue.js 
:2:15) 
    at Module._compile (module.js:541:32) 

哪個節點JS的版本,我應該使用,任何一個環節下載??

回答

0

我找到了我的問題的解決方案, 只需下載較低版本,您的代碼即可正常工作: