PS C:\Users\jjoob\myfirstmap\myfirstmap> nodemon ./bin/www [nodemon] 3.1.7 [nodemon] to restart at any time, enter rs [nodemon] watching path(s): . [nodemon] watching extensions: js,mjs,cjs,json [nodemon] starting node ./bin/www node:internal/modules/cjs/loader:1252 throw err; ^ Error: Cannot find module 'morgan' Require stack: - C:\Users\jjoob\myfirstmap\myfirstmap\app.js - C:\Users\jjoob\myfirstmap\myfirstmap\bin\www at Function._resolveFilename (node:internal/modules/cjs/loader:1249:15) at Function._load (node:internal/modules/cjs/loader:1075:27) at TracingChannel.traceSync (node:diagnostics_channel:315:14) at wrapModuleLoad (node:internal/modules/cjs/loader:218:24) at Module.require (node:internal/modules/cjs/loader:1340:12) at require (node:internal/modules/helpers:141:16) at Object.<anonymous> (C:\Users\jjoob\myfirstmap\myfirstmap\app.js:5:14) at Module._compile (node:internal/modules/cjs/loader:1546:14) at Object..js (node:internal/modules/cjs/loader:1689:10) at Module.load (node:internal/modules/cjs/loader:1318:32) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\\Users\\jjoob\\myfirstmap\\myfirstmap\\app.js', 'C:\\Users\\jjoob\\myfirstmap\\myfirstmap\\bin\\www' ] } Node.js v22.11.0 [nodemon] app crashed - waiting for file changes before starting... PS C:\Users\jjoob\myfirstmap\myfirstmap> 다 지우고 처음부터 다시 실행해봐도 계속 같은 오류이고 localhost:3000 실행하면 흠… 이 페이지에 연결할 수 없습니다. localhost 이(가) 연결을 거부했습니다. 이렇게 나오네요 ㅠ (nodemon ./bin/www 입력 시 오류)
\안녕하세요. 제가 윈도우 환경에서는 모두 완벽히 설치하여 잘 사용하였는데 맥북 m1으로 컴퓨터를 바꾸고 다시 해보려하니까 새롭게 설치도 다시하고 했는데 안되네요,,, 이유를 잘 모르겠어서 질문 남깁니다... 정말 맥북사고 쓰지도 못하고 골치가 아파요.. 한번만 도와주세요 뭐가 문제 일까요?? 이후 다시 새롭게 만들어 해봤더니 sql이 연동이 되지 않고 있는 것 같습니다. sql연동 전에는 npm run start가 되네요
8강 시청중에 노드몬 부분에서 index.js의 내용을 변경하였는데도 [nodemon] restarting due to chages가 뜨지 않았습니다. 이러한 문제는 일부 네트워크의 환경 문제라고 합니다. 이를 해결하기 위해서는 index.js의 scripts의 backend 부분을 저렇게 작성해주는 것입니다. 그러면 정상적으로 작동하게 됩니다. 혹시나 같은 문제로 고민하는 분이 있으시면 도움이 됐으면 좋겠습니다. John Ahn 님 덕분에 좋은 퀄리티의 수업 잘 듣고 있습니다. 감사합니다. 출처: https://stackoverflow.com/questions/37622606/nodejs-nodemon-not-restarting-my-server