我的代码有一个问题,我在app.js中使用了以下代码: const mongoose = require('mongoose'); PORT:8080 出于某种原因,它给了我一个奇怪的错误: throw new MongooseError('The `uri` parameter to `openUri()` must be a ' +
我是MongoDB的新手,我只是在我的Ubuntu终端中设置了MongoDB,其中包含了运行在不同终端中的mongod和mongo命令。然而,我无法得到我的app.js,可以启动一个网站正常运行。: The `uri` parameter to `openUri()` must be a string, got "undefined".at new MongooseError (/home/ubuntu/modeltes
我正在尝试在freecodecamp上开始mongoDB和mongoose挑战,并想通过heroku部署的web应用程序来回答。我已经通过连接mongoose和数据库的heroku应用程序成功地完成了第一个挑战。但是当我尝试在本地运行代码时,它返回这个错误。throw new MongooseError('The `uri` parameter to `openUri()` must be a ' +
MongooseError: The `uri
} console.log("Server started at port "+PORT)现在它抛出error作为Error MongooseError:openUri()的uri参数必须是一个字符串,得到"undefined“。确保mongoose.connect()或mongoose.createConnection()的第一个参数</e