• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

안녕하세요 질문합니다 오류가생기네요

21.01.31 21:56 작성 조회수 609

1

오류도 없고  f12눌러서 봤는데 저런 오류가뜨는데요 저거때문에 잘안되네요 InfoWindow({ 여기서 빨간 오류뜨네요 f12눌렀는데요

답변 23

·

답변을 작성해보세요.

1

임권일님의 프로필

임권일

질문자

2021.02.05

좌표 데이터 MongoDB에 저장하기 여기 강의에서 

<button onClick="onSubmit('${title}','${address}',${lat},${lng});">등록</button>
여기 그냥 등록버튼하면 되는데요 클릭했을때 버튼이 오류가나요
('${title}','${address}',${lat},${lng});">등록</button>
야기서 f12누르면 자꾸 빨간글씨가 나와요 고쳐도 안되네요
조금만더하면 완성인데 여기서 걸리네요

1

임권일님의 프로필

임권일

질문자

2021.02.04

아 이제 해결했네요 그래도 감사합니다 그때는 제가 몽고가 잘못설정을해서 오류가 났서요 그래서 이제 잘되네요 답변해주셔셔 감사합니다 나중에 다른오류 나면 그때 말하겠습니다 좋은꿈구세요 

1

임권일님의 프로필

임권일

질문자

2021.02.01

var app = require('../app');
var debug = require('debug')('firstmap:server');
var http = require('http');
const mongoose = require("mongoose");
const userConfig = require("../config/userConfig.json");
const { TooManyRequests } = require('http-errors');

let db = mongoose.connection;
db.on("error",console.error);
db.once("open", () => {
  console.log("connected to mongo Server");
});

mongoose.connect(
  `mongodb+srv://qnzjn1:${userConfig.pw}rkdmfdl12?@qnzjn.t8oja.mongodb.net/firstmap?retryWrites=true&w=majority`,
  {useNewUrlParser:trueuseUnifiedToplogy:true}
);


아까 그 코드입니다

0

질문 감사합니다~!!

브라우저 f12에서 나오는 에러를 캡쳐해서 보내주실 수 있을까요??

0

다행입니다:)

임임권일님도 홧팅하세요~~!!!

0

혹시 www도 캡쳐해서 보내주실 수 있을까요??

해결될 때까지 최선을 다해서 도와드리겠습니다:)

0

임권일님의 프로필

임권일

질문자

2021.02.03

파일명이나 파일 위치는 다 맞는데 안되네요 제 컴퓨터가 문제가있는가요??

0

현재 userConfig.json 파일을 못 찾는 것 같습니다~!!

혹시 파일 위치나 파일명이 제대로 되어있는지 확인 부탁드립니다:)

0

임권일님의 프로필

임권일

질문자

2021.02.02

자꾸 물어보는것도 정말 죄송합니다 아직까지 해결도 못하고있네요 왜 안되는건가요??

저번 강의 코로나맵지도는 성공했는데 이번에 어렵네요 

자꾸 오류가 뜨네요 

> firstmap@0.0.0 start

> nodemon ./bin/www

[nodemon] 2.0.7

[nodemon] to restart at any time, enter `rs`

[nodemon] watching path(s): *.*

[nodemon] watching extensions: js,mjs,json

[nodemon] starting `node ./bin/www`

node:internal/modules/cjs/loader:928

  throw err;

  ^

Error: Cannot find module '../config/userConfig.json'

Require stack:

- C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\bin\www

    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15)

    at Function.Module._load (node:internal/modules/cjs/loader:769:27)

    at Module.require (node:internal/modules/cjs/loader:997:19)

    at require (node:internal/modules/cjs/helpers:92:18)

    at Object.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\bin\www:11:20)

    at Module._compile (node:internal/modules/cjs/loader:1108:14)

    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)

    at Module.load (node:internal/modules/cjs/loader:973:32)

    at Function.Module._load (node:internal/modules/cjs/loader:813:14)

    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)        

    at node:internal/main/run_main_module:17:47 {

  code: 'MODULE_NOT_FOUND',

  requireStack: [ 'C:\\Users\\qnzjn\\OneDrive\\바탕 화면\\firstmap\\bin\\www' ]

}

[nodemon] app crashed - waiting for file changes before starting...

0

현재 Pw로 되어 있는 것 같습니다~~! pw로 바꿔본 후에 다시 실행해보실 수 있을까요?

그리고 위의 질문은 개인정보 때문에 지워주시면 감사하겠습니다:)

0

임권일님의 프로필

임권일

질문자

2021.02.01

userConfig.json 이폴더에서 오류가 있는가요  
{
    "Pw" : "rkdmfdl12"
}
> firstmap@0.0.0 start > nodemon ./bin/www [nodemon] 2.0.7 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node ./bin/www` node:internal/modules/cjs/loader:928 throw err; ^ Error: Cannot find module '../config/userConfig.json' Require stack: - C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\bin\www at Function.Module._resolveFilename (node:internal/modules/cjs/loader:925:15) at Function.Module._load (node:internal/modules/cjs/loader:769:27) at Module.require (node:internal/modules/cjs/loader:997:19) at require (node:internal/modules/cjs/helpers:92:18) at Object.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\bin\www:11:20) at Module._compile (node:internal/modules/cjs/loader:1108:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10) at Module.load (node:internal/modules/cjs/loader:973:32) at Function.Module._load (node:internal/modules/cjs/loader:813:14) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Users\\qnzjn\\OneDrive\\바탕 화면\\firstmap\\bin\\www' ] } [nodemon] app crashed - waiting for file changes before starting...

0

userConfig.json 에서 에러가 뜨는 것 같습니다~@@

한번 확인 부탁드립니다:)

0

임권일님의 프로필

임권일

질문자

2021.02.01

이런오류가떠요 

> firstmap@0.0.0 start

> nodemon ./bin/www

[nodemon] 2.0.7

[nodemon] to restart at any time, enter `rs`

[nodemon] watching path(s): *.*

[nodemon] watching extensions: js,mjs,json

[nodemon] starting `node ./bin/www`

node:internal/modules/cjs/loader:1154

    throw err;

    ^

SyntaxError: C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\config\userConfig.json: Unexpected end of JSON input

    at parse (<anonymous>)

    at Object.Module._extensions..json (node:internal/modules/cjs/loader:1151:22)

    at Module.load (node:internal/modules/cjs/loader:973:32)

    at Function.Module._load (node:internal/modules/cjs/loader:813:14)

    at Module.require (node:internal/modules/cjs/loader:997:19)

    at require (node:internal/modules/cjs/helpers:92:18)

    at Object.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\bin\www:11:20)

    at Module._compile (node:internal/modules/cjs/loader:1108:14)

    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)

    at Module.load (node:internal/modules/cjs/loader:973:32)

    at Function.Module._load (node:internal/modules/cjs/loader:813:14)

    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)        

    at node:internal/main/run_main_module:17:47

[nodemon] app crashed - waiting for file changes before starting...

0

아닙니다 ㅎㅎ

혹시 오류 메세지는 어떻게 뜨는지 확인할 수 있을까요?

0

임권일님의 프로필

임권일

질문자

2021.02.01

그래도 안되요 왜그런거죠??  잘안되니깐 자꾸 물어보는데 너무 죄송합니다

0

저기 혹시 rk*****12?는 무엇인가요??

삭제후 다시 시도해보실 수 있을까요?

0

그건 아닌 것 같습니다~!!

음.. 전체 코드를 좀 봐야할 것 같은데 혹시 github에 올려놓으신 것 있을까요??

0

임권일님의 프로필

임권일

질문자

2021.02.01

그래도 안됩니다 제 컴퓨터 문제가있나요??

0

오류 확인 결과 인증 오류인 것 같습니다~!!

${userConfig.pw} 앞에 <> 이 문자 2개를 지워 주신 후에 다시한번 시도해보시기 바랍니다~!!

문제 발생시 다시한번 질문 주시기 바랍니다~!!

0

임권일님의 프로필

임권일

질문자

2021.02.01

npm install 하고 npm start 이렇게 쳤는데 오류떠요

(node:14656) DeprecationWarning: 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.

(Use `node --trace-deprecation ...` to show where the warning was created)

MongoNetworkError: failed to connect to server [qnzjn-shard-00-01.t8oja.mongodb.net:27017] on first connect [MongoError: bad auth : Authentication failed.

    at Connection.messageHandler (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:359:19)

    at Connection.emit (node:events:379:20)

    at processMessage (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:451:10)

    at TLSSocket.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:620:15)

    at TLSSocket.emit (node:events:379:20)

    at addChunk (node:internal/streams/readable:313:12)

    at readableAddChunk (node:internal/streams/readable:288:9)

    at TLSSocket.Readable.push (node:internal/streams/readable:227:10)

    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {

  ok: 0,

  code: 8000,

  codeName: 'AtlasError'

}]

    at Pool.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\topologies\server.js:438:11)

    at Pool.emit (node:events:379:20)

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\pool.js:562:14

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\pool.js:1009:9

    at callback (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connect.js:75:5)

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connect.js:147:27

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\auth\scram.js:185:14

    at _callback (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:328:7)

    at Connection.messageHandler (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:359:9)

    at Connection.emit (node:events:379:20)

    at processMessage (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:451:10)

    at TLSSocket.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:620:15)

    at TLSSocket.emit (node:events:379:20)

    at addChunk (node:internal/streams/readable:313:12)

    at readableAddChunk (node:internal/streams/readable:288:9)

    at TLSSocket.Readable.push (node:internal/streams/readable:227:10)

node:internal/process/promises:227

          triggerUncaughtException(err, true /* fromPromise */);

          ^

 

MongoNetworkError: failed to connect to server [qnzjn-shard-00-01.t8oja.mongodb.net:27017] on first connect [MongoError: bad auth : Authentication failed.

    at Connection.messageHandler (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:359:19)

    at Connection.emit (node:events:379:20)

    at processMessage (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:451:10)

    at TLSSocket.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:620:15)

    at TLSSocket.emit (node:events:379:20)

    at addChunk (node:internal/streams/readable:313:12)

    at readableAddChunk (node:internal/streams/readable:288:9)

    at TLSSocket.Readable.push (node:internal/streams/readable:227:10)

    at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23) {

  ok: 0,

  code: 8000,

  codeName: 'AtlasError'

}]

    at Pool.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\topologies\server.js:438:11)

    at Pool.emit (node:events:379:20)

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\pool.js:562:14

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\pool.js:1009:9

    at callback (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connect.js:75:5)

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connect.js:147:27

    at C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\auth\scram.js:185:14

    at _callback (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:328:7)

    at Connection.messageHandler (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:359:9)

    at Connection.emit (node:events:379:20)

    at processMessage (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:451:10)

    at TLSSocket.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\node_modules\mongodb\lib\core\connection\connection.js:620:15)

    at TLSSocket.emit (node:events:379:20)

    at addChunk (node:internal/streams/readable:313:12)

    at readableAddChunk (node:internal/streams/readable:288:9)

    at TLSSocket.Readable.push (node:internal/streams/readable:227:10)

[nodemon] app crashed - waiting for file changes before starting...

0

질문 주셔서 감사합니다:)

혹시 npm install 하신 후에 동일한 문제가 발생하는지 다시 답글 부탁드립니다~!!

0

임권일님의 프로필

임권일

질문자

2021.02.01

ㄴㄴ

안녕하세요 mongoose 패키지 설치 및 설정 강의에서  

코드 적었는데요 

app.set('port', port);

^

 

ReferenceError: app is not defined

    at Object.<anonymous> (C:\Users\qnzjn\OneDrive\바탕 화면\firstmap\bin\www:14:1)

    at Module._compile (node:internal/modules/cjs/loader:1108:14)

    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1137:10)

    at Module.load (node:internal/modules/cjs/loader:973:32)

    at Function.Module._load (node:internal/modules/cjs/loader:813:14)

    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)        

    at node:internal/main/run_main_module:17:47

[nodemon] app crashed - waiting for file changes before starting...

이런오류가떠요 업로드 페이지 CSS 적용 강의에서 코드적고 npm start  이렇게 치니깐 저렇게 오류가떠요 지도가 안나오네요 

0

안녕하세요 임임권일님~!! 질문 주셔서 감사드립니다:)

확인해본 결과 Maps가 maps로 변경되어야 할 것 같습니다~!!

해당 문제 동일 발생시 다시 질문 주시기 바랍니다~!!

감사합니다:)

const infowindow = new naver.maps.InfoWindow({
content: content,
backgroundColor: "#00ff0000",
borderColor: "#00ff0000",
anchorSize: new naver.maps.Size(0, 0),
});