【发布时间】:2018-07-07 21:35:42
【问题描述】:
我有一个 node.js 应用程序要与 rabbitmq 和 mysql 一起运行。
设置好一切后,当我做npm start
我已将用户管理员标记和权限指定为 rabbitmqctl set_permissions RABBIT_USERNAME "." "." ".*"
它显示了这个错误:
> node app.js
13:43
Started database log (Mon Jan 29 2018 13:43:42 GMT+0530 (IST))
13:43
Started mailer log (Mon Jan 29 2018 13:43:44 GMT+0530 (IST))
13:43
Started messaging log (Mon Jan 29 2018 13:43:44 GMT+0530 (IST))
13:43
Started messaging log (Mon Jan 29 2018 13:43:44 GMT+0530 (IST))
13:43
Started database log (Mon Jan 29 2018 13:43:44 GMT+0530 (IST))
13:43
Started socket log (Mon Jan 29 2018 13:43:44 GMT+0530 (IST))
13:43 messaging:3000 is listening..
13:43 DB connected (7)
13:43 DB connected (6)
13:43 Error:
Expected ConnectionOpenOk; got <ConnectionClose channel:0>
Error: Expected ConnectionOpenOk; got <ConnectionClose channel:0>
at /PATH/node_modules/amqplib/lib/connection.js:167:14
at /PATH/node_modules/amqplib/lib/connection.js:159:12
at Socket.recv (/PATH/node_modules/amqplib/lib/connection.js:497:12)
at Object.onceWrapper (events.js:255:19)
at Socket.emit (events.js:160:13)
at emitReadable_ (_stream_readable.js:520:10)
at emitReadable (_stream_readable.js:514:7)
at addChunk (_stream_readable.js:280:7)
at readableAddChunk (_stream_readable.js:256:11)
at Socket.Readable.push (_stream_readable.js:213:10)
at TCP.onread (net.js:599:20)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! messaging@ start: `node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the messaging@ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mishal23/.npm/_logs/2018-01-29T08_13_45_095Z-debug.log
【问题讨论】:
-
什么版本的 RabbitMQ?什么版本的节点?您是否在 RabbitMQ 日志中看到错误?您是否通过the tutorials 工作过?请提供您的代码(或至少是连接到 RabbitMQ 的部分)。我确信有一个简单的修复方法。