我正在尝试在freecodecamp上开始mongoDB和mongoose挑战,并想通过heroku部署的web应用程序来回答。我已经通过连接mongoose和数据库的heroku应用程序成功地完成了第一个挑战。但是当我尝试在本地运行代码时,它返回这个错误。throw new MongooseError('The `uri` parameter to `openUri()` must be a ' +
MongooseError: The `uri
我的代码有一个问题,我在app.js中使用了以下代码: const mongoose = require('mongoose'); PORT:8080 出于某种原因,它给了我一个奇怪的错误: throw new MongooseError('The `uri` parameter to `openUri()` must be a ' +
} console.log("Server started at port "+PORT)现在它抛出error作为Error MongooseError:openUri()的uri参数必须是一个字符串,得到"undefined“。确保mongoose.connect()或mongoose.createConnection()