问题描述
我有一个相当老的NodeJS应用,其中包含以下package.json
{
"name": "simplevote","version": "1.0.3","private": true,"scripts": {
"start": "node app"
},"dependencies": {
"MD5": "*","async": "*","body-parser": "*","cookie": "*","express": "4.*","jade": "*","less-middleware": "*","marked": "*","mongodb": "^3.6.0","mongoose": "^3.8.40","node-uuid": "*","nodemailer": "*","nodemailer-direct-transport": "*"
}
}
我在CentOS 6.9中安装了mongo服务器列表
mongodb-2.4.14-4.el6.x86_64
mongoose-3.1-2.el6.x86_64
libmongodb-2.4.14-4.el6.x86_64
mongoose-devel-3.1-2.el6.x86_64
mongoose-lib-3.1-2.el6.x86_64
mongodb-server-2.4.14-4.el6.x86_64
以下是连接到本地(127.0.0.1)mongo服务器(确认服务器正在运行)的代码:
var mongoose = require('mongoose');
// Connect to database
mongoose.connect('mongodb://localhost/survey');
mongoose.connection.once('connected',function() {
console.log('Successfully connected to MongoDB.')
}).on('error',function(e){console.log({"ERR": e})});
// ...more...
问题:
无论我使用IP _state
还是connecting
,(127.0.0.1)
仍然是localhost
。
没有错误,没有日志(只说服务器正在运行),没有响应,什么都没有。
我想知道这是否是mongo服务器和客户端versino问题,但我没有发现。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)