我使用的源码是github上的: https://github.com/cnodejs/nodeclub/ 使用PM2启动club,查看日志发现错误。应该是根mongodb有关,我的mongodb是3.0,nodejs的版本是v0.10.36
club-1 (err): at /usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/cursor.js:162:16
club-1 (err): at commandHandler (/usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/cursor.js:706:16)
club-1 (err): at /usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/db.js:1806:9
club-1 (err): at Server.Base._callHandler (/usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/base.js:442:41)
club-1 (err): at /usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:485:18
club-1 (err): at [object Object].MongoReply.parseBody (/usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
club-1 (err): at [object Object].<anonymous> (/usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/server.js:443:20)
club-1 (err): at [object Object].emit (events.js:95:17)
club-1 (err): at [object Object].<anonymous> (/usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/connection_pool.js:191:13)
club-1 (err): at [object Object].emit (events.js:98:17)
club-1 (err): at Socket.<anonymous> (/usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/connection/connection.js:418:22)
club-1 (err): at Socket.emit (events.js:95:17)
club-1 (err): at Socket.<anonymous> (_stream_readable.js:765:14)
club-1 (err): at Socket.emit (events.js:92:17)
club-1 (err): at emitReadable_ (_stream_readable.js:427:10)
club-1 (err): at emitReadable (_stream_readable.js:423:5)
club-1 (err): at readableAddChunk (_stream_readable.js:166:9)
club-1 (err): at Socket.Readable.push (_stream_readable.js:128:10)
club-1 (err): at TCP.onread (net.js:529:21)
另外,在make test时也报错了: Uncaught Error: Error setting TTL index on collection : sessions
大家帮我看看问题吧,谢谢了!
看到错误日志里面有这句:MongoReply.parseBody (/usr/local/nginx/html/club/node_modules/connect-mongo/node_modules/mongodb/lib/mongodb/responses/mongo_reply.js:68:5)
感觉问题是跟 mongodb 有关
后来发现,注册邮件无法收到,我的邮件配置如下: 使用的是126的邮箱 // 邮箱配置 mail_opts: { host: 'smtp.126.com’, port: 25, auth: { user: '[email protected]’, pass: ‘xxx’ } },
@alsotang 恩,我把debug设置为false,但是又报了另外一个错误:
AuthError: Invalid login - 550 �û�������
后面的详细信息是乱码看不到。 后来开源码发现是用的simplesmtp来发送邮件的,上github查看simplesmtp的错误列表,发现AuthError类型的错误是用户名密码错误,但是我确定我的用户名密码是对的。因为详细信息是乱码,github查看simplesmtp上也找不到错误代码跟解释信息的对应列表。不知道我的126邮箱需要设置什么吗?
AuthError - the username/password used were rejected