我对此进行了很多搜索,但没有一个可以帮助我。
当我运行我的项目时,我收到此错误:
/home/ali/Desktop/personalitytest-backend/node_modules/mongoose/lib/connection.js:428 throw new MongooseError('The
uriparameter toopenUri()must be a ' + ^ MongooseError: Theuriparameter toopenUri()must be a string, got "undefined" . 确保第一个参数 tomongoose.connect()或mongoose.createConnection()是一个字符串。
我的 index.js 文件:
const express = require('express'),
app = express(),
mongoose = require('mongoose'),
rateLimit = new require('express-rate-limit')({
windowMs: 1000 * 60 * 10,
max: 500,
handler: (req, res) => {
res.json({
data: 'Your request was too much, please try again in 10 minutes later.',
status: …Run Code Online (Sandbox Code Playgroud)