• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

[이유를 모르겠는데 해결되었습니다] [nodemon] Could not shutdown sub process cleanly

21.10.27 13:30 작성 조회수 346

0

[이유는 모르겠지만.. 회사 업무 시스템을 꺼서 그런지 해결되었습니다. 정상적으로 restart 됩니다. 감사합니다]
 
안녕하세요, 강사님 강의 감사히 잘 듣고있습니다.
 
Nodemon 설치 중에는 전혀 문제가 없었는데,
구글링 해도 나오지 않는 문제가 있어 질문드립니다.
 
구동까지 잘 되고, 기능상 문제가 없습니다.
그런데, 소스를 수정 후 저장버튼을 누르면
[nodemon] restarting due to changes... [nodemon] Could not shutdown sub process cleanly
이런 메세지가 발생합니다.
별것 다 해본 것 같은데 해결법을 찾지 못했습니다 ㅠㅠ 도와주실 수 있을까요?
 
 
아래 터미널과 index.js, package.json 소스 공유드립니다.
 
 
D:\GitHub\react\boiler-plate>npm run backend > boiler-plate@1.0.0 backend D:\GitHub\react\boiler-plate > nodemon index.js [nodemon] 2.0.14 [nodemon] to restart at any time, enter `rs` [nodemon] watching path(s): *.* [nodemon] watching extensions: js,mjs,json [nodemon] starting `node index.js` Example app listening at http://localhost:5000 MongoDB Connected... [nodemon] restarting due to changes... [nodemon] Could not shutdown sub process cleanly [nodemon] restarting due to changes... [nodemon] Could not shutdown sub process cleanly
 
 
packages.json 파일은 이것저것 시도해보다 devDependencies에서 dependencies로 옮겨가게 되었습니다. (dev 태그를 빼고 설치해봤습니다..)
 
packages.json
{
  "name": "boiler-plate",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "start": "node index.js",
    "backend": "nodemon index.js",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "injun",
  "license": "ISC",
  "dependencies": {
    "body-parser": "^1.19.0",
    "express": "^4.17.1",
    "mongoose": "^6.0.12",
    "nodemon": "^2.0.14"
  },
  "devDependencies": {}
}
 
 
idnex.js
const express = require('express');
const app = express();
const port = 5000;

const bodyParser =  require('body-parser');
app.use(bodyParser.urlencoded({extended: true}));
app.use(bodyParser.json());


const {User} = require("./models/User");

const mongoose = require('mongoose');
mongoose.connect('@@@',{
   
}).then(() => console.log('MongoDB Connected...'))
.catch(err => console.log(err));


app.get('/', (req, res) => {
  res.send('Hello World!2100000');
});

app.post('/register', (req, res) => {

  // 회원가입할 때 필요한 정보들을 client에서 가져오면
  // 그것들을 데이터베이스에 넣어준다.
  const user = new User(req.body);

  user.save((err, doc) => {
    if(err) return res.json({ success: false, err})
    return res.status(200).json({
      success: true
    })
  });



});

app.listen(port, () => {
  console.log(`Example app listening at http://localhost:${port}`)
});

답변 1

답변을 작성해보세요.

0

안녕하세요 !!! 

이 부분은 제가 처음 본 에러이며, 에러 로그를 이용해서 구글링해봐도 답변이 전혀 없네요 ㅠㅠ 
소스 코드로 인한 에러가 아닌 컴퓨터 자체와 nodemon을 사용할 때 충돌이 나는것 같은데 
만약 에러가 계속 난다면 우선 nodemon을 이용하지 않고 우선 node index.js를 이용해주시겠어요?!!