Mongoose / MongoDB错误:无法确定服务器

时间:2017-01-30 10:11:23

标签: node.js mongodb mongoose

突然间,我在本地运行我的应用时遇到了这个错误。据我所知,上次工作和现在之间没有任何变化。它似乎是数据库层上的错误,因为它发生在应用程序尝试执行某些与DB相关的任务时。

我尝试升级node,npm,mongoose,mongodb,但我仍然遇到同样的错误。

我可以提供很多信息,但我不知道最相关的信息,所以让我知道还有什么需要帮助解决这个问题。

我还附上了我目前的package.json

error displayed in browser

{

  "engines": {
    "node": "0.10.x",
    "npm": "1.4.x"
  },
  "scripts": {
    "start": "grunt",
    "test": "grunt test",
    "postinstall": "bower install --config.interactive=false && node ./bson.installation.fix.js"
  },
  "dependencies": {
    "angular": "^1.5.0",
    "async": "~0.9.0",
    "body-parser": "~1.9.0",
    "bower": "~1.3.8",
    "chalk": "~0.5",
    "compression": "~1.2.0",
    "connect-flash": "~0.1.1",
    "connect-mongo": "^0.4.1",
    "consolidate": "~0.10.0",
    "cookie-parser": "~1.3.2",
    "excel-export": "^0.4.1",
    "express": "~4.10.1",
    "express-session": "~1.9.1",
    "forever": "~0.11.0",
    "glob": "~4.0.5",
    "grunt": "0.4.5",
    "grunt-cli": "~0.1.13",
    "helmet": "~0.5.0",
    "json2xls": "0.0.5",
    "lodash": "~2.4.1",
    "method-override": "~2.3.0",
    "mocha": "~1.20.0",
    "moment": "^2.10.6",
    "mongoose": "^3.8.8",
    "morgan": "~1.4.1",
    "needle": "^0.11.0",
    "nodemailer": "~1.3.0",
    "nodemailer-sendgrid-transport": "^0.2.0",
    "passport": "~0.2.0",
    "passport-facebook": "~1.0.2",
    "passport-github": "~0.1.5",
    "passport-google-oauth": "~0.1.5",
    "passport-linkedin": "~0.1.3",
    "passport-local": "~1.0.0",
    "passport-twitter": "~1.0.2",
    "request": "^2.60.0",
    "stripe": "^3.6.0",
    "swig": "~1.4.1",
    "validator": "^3.41.2"
  },
  "devDependencies": {
    "eslint": "^2.2.0",
    "eslint-config-defaults": "^9.0.0",
    "grunt-concurrent": "~1.0.0",
    "grunt-contrib-csslint": "^0.3.1",
    "grunt-contrib-cssmin": "~0.10.0",
    "grunt-contrib-jshint": "~0.10.0",
    "grunt-contrib-uglify": "~0.6.0",
    "grunt-contrib-watch": "~0.6.1",
    "grunt-env": "~0.4.1",
    "grunt-karma": "~0.9.0",
    "grunt-mocha-test": "~0.12.1",
    "grunt-ng-annotate": "~0.4.0",
    "grunt-node-inspector": ">=0.1.3",
    "grunt-nodemon": "~0.4.1",
    "karma": "~0.12.0",
    "karma-chrome-launcher": "~0.1.2",
    "karma-coverage": "~0.2.0",
    "karma-firefox-launcher": "~0.1.3",
    "karma-jasmine": "~0.2.1",
    "karma-phantomjs-launcher": "~0.1.2",
    "karma-verbose-reporter": "0.0.3",
    "load-grunt-tasks": "~1.0.0",
    "should": "~4.1.0",
    "supertest": "~0.14.0"
  }
}

1 个答案:

答案 0 :(得分:3)

当我切换到使用Yarn而不是NPM处理模块时,我不知不觉地更新了我的Node版本。我必须安装节点v6.1.3。