-
글쓴이글
-
2022년 2월 15일 23:27 #27395
이혁진참가자(node:4340) [MONGODB DRIVER] Warning: Current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(Usenode --trace-warnings ...
to show where the warning was created)
node:events:498
throw er; // Unhandled 'error' event
^Error: listen EADDRINUSE: address already in use :::8080
at Server.setupListenHandle [as _listen2] (node:net:1330:16)
at listenInCluster (node:net:1378:12)
at Server.listen (node:net:1465:7)
at Function.listen (E:\코딩애플\node.js.apple\node_modules\express\lib\application.js:618:24)
at E:\코딩애플\node.js.apple\server.js:18:7
at E:\코딩애플\node.js.apple\node_modules\mongodb\lib\utils.js:704:5
at E:\코딩애플\node.js.apple\node_modules\mongodb\lib\mongo_client.js:286:7
at connectCallback (E:\코딩애플\node.js.apple\node_modules\mongodb\lib\operations\connect.js:367:5)
at E:\코딩애플\node.js.apple\node_modules\mongodb\lib\operations\connect.js:557:5
at ReplSet.connectHandler (E:\코딩애플\node.js.apple\node_modules\mongodb\lib\topologies\replset.js:337:9)
Emitted 'error' event on Server instance at:
at emitErrorNT (node:net:1357:8)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
code: 'EADDRINUSE',
errno: -4091,
syscall: 'listen',
address: '::',
port: 8080
}
[nodemon] app crashed - waiting for file changes before starting...2022년 2월 15일 23:27 #27396
이혁진참가자const express = require('express');
const app = express();
const bodyParser= require('body-parser')
app.use(bodyParser.urlencoded({extended: true}));
const MongoClient = require('mongodb').MongoClient;
var db;
MongoClient.connect('mongodb+srv://@cluster0.z68vo.mongodb.net/todoapp?retryWrites=true&w=majority', function(에러, client){
if (에러) return console.log(에러)
db = client.db('todoapp');
db.collection('post').insertOne({이름 : 'john', 나이 : 20} , function(에러, 결과){
console.log('저장완료');//db에 저장하기
});app.listen(8080, function() {
console.log('listening on 8080')
});
});2022년 2월 16일 16:55 #27462
이혁진참가자아예 처음부터 다시 설치하고 하였는데도 똑같이 에러가 나요 ..... 제 url 주소(패스워드입력)란에 몽고디비atlas 비밀번호에 특수문자가들어가있는데 그것때문일까요 ?....
2022년 2월 16일 23:05 #27497
codingapple키 마스터그럴 수도 있는데 저건 다른 에러같습니다
app.listen(8081, function() {
console.log('listening on 8081')
});이런 식으로 써서 localhost:8081 로 접속해서 테스트해봅시다
-
글쓴이글
- 답변은 로그인 후 가능합니다.