작성
·
1K
0
이러한 에러가 뜨는데 어디서부터 무엇이 잘못된건지 햇갈리네요 ㅜ 왜 이런 에러가 뜨는 걸까요??
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module '/../config/config.json'
Require stack:
- C:\Users\com\vue강좌\라우터복습\ch4\back\models\index.js
- C:\Users\com\vue강좌\라우터복습\ch4\back\app.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (C:\Users\com\vue강좌\라우터복습\ch4\back\models\index.js:3:16)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Module.require (internal/modules/cjs/loader.js:952:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'C:\\Users\\com\\vue강좌\\라우터복습\\ch4\\back\\models\\index.js',
'C:\\Users\\com\\vue강좌\\라우터복습\\ch4\\back\\app.js'
]
}
[nodemon] app crashed - waiting for file changes before starting...
답변 5
0
index.js 에 '../config/config.json
이부분 앞에 슬래쉬 하나가 더 들어 간거 같아서 제거하고 npm run dev를 해보니 이번엔 좀 다르게 뜨네요 ㅜㅜ
[nodemon] restarting due to changes...
[nodemon] starting `node app.js`
백앤드 서버 3085번 포트에서 작동중
(node:26792) UnhandledPromiseRejectionWarning: SequelizeConnectionRefusedError: connect ECONNREFUSED 127.0.0.1:3306
at ConnectionManager.connect (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\mysql\connection-manager.js:116:17)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async ConnectionManager._connect (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:318:24)
at async C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:250:32
at async ConnectionManager.getConnection (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\connection-manager.js:280:7)
at async C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\sequelize.js:613:26
at async MySQLQueryInterface.createTable (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\dialects\abstract\query-interface.js:225:12)
at async Function.sync (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\model.js:1300:5)
at async Sequelize.sync (C:\Users\com\vue강좌\라우터복습\ch4\back\node_modules\sequelize\lib\sequelize.js:793:35)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:26792) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:26792) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
빨갛게 뜨지 않는거 보니 에러같은건 아닌거 같은데 ㅜ 백앤드 들어와서 힘드네요 ㅜ
0
0
app.js
0
user.js
0
index.js
답변 감사합니다 강사님!!
고치고 npx sequelize db:create라고 쳤는데
Sequelize CLI [Node: 14.16.0, CLI: 6.2.0, ORM: 6.6.5]
Loaded configuration file "config\config.json".
Using environment "development".
ERROR: connect ECONNREFUSED 127.0.0.1:3306
이렇게 뜨는거는 어떤 이유일까요??ㅜ
예 감사합니다 강사님
어제 mysql 깔고 실행시켰는데
Sequelize CLI [Node: 14.16.0, CLI: 6.2.0, ORM: 6.6.5]
Loaded configuration file "config\config.json".
Using environment "development".
ERROR: Access denied for user 'root'@'localhost' (using password: YES)
이러한 에러가 뜹니다 ㅜ 구글링 해보니 비번이 잘못 되서 그렇다고 하는데 mysql workbrench 하고 명령 프롬프터에서도 비번 치고 들어가졌는데 뭐가 문제인지 잘 모르겠습니다 ㅜ
require('../config/config.json') 입니다.