我收到此错误
当我尝试在反应项目上测试代码时:
var amqp = require('amqplib/callback_api');
export function start2 (conn) {
console.log("hello")
amqp.connect('amqp://localhost:8000', function (err, conn) {
conn.createChannel(function(err, ch) {
var q = 'frontend';
var msg = 'Hello!';
ch.assertQueue(q, {durable: false});
// Note: on Node 6 Buffer.from(msg) should be used
ch.sendToQueue(q, new Buffer(msg));
console.log(" [x] Sent %s", msg);
});
setTimeout(function() { conn.close(); process.exit(0) }, 500);
});
}
任何帮助请和谢谢。