코드/Trouble Shoot

[Nodemon] Webstorm 디버그 모드

Yeah-Panda 2023. 2. 12. 20:53

Nodejs  개발과정에서 nodemon 과 디버깅은 필수 항목이다.

웹스톰의 Node 디버그 모드는 수정된 내용의 반영을 위해 서버를 새로 구동해야하는 불편함이 있다.

(비록 nodemon 이 돌아가고 있는 상황이라도)

해서 다음처럼 세팅한다.

 

Run > Degub Configurations 메뉴로 진입

이미 Debug 모드를 돌렸으니 다음과 같은 세팅이 되어있을테고

거기에 Node parameters 항목에 nodemon 설치 경로를 입력한다

잘 모르겠다면 `which nodemon` : (맥환경)

기본 적인 원리는 웹스톰의 디버깅 모드를 돌려 놓고 그 상황에서 nodemon 디버깅 모드를 하나 더 돌린다고 보면 된다.

하여 추가 버튼 (+)  혹은 add configuration 을 눌러서 nodemon 이라는 디버깅 설정을 추가로 만들자

 

그리고 Node parameters  에 nodemon 경로 --inspect-brk=포트번호

유저/유저계정명/.nvm/versions/node/v16.18.1/bin/nodemon --inpect-brk=5959

이런 형태가 되고 적용 버튼을 누른다

그리고 상단의 디버그 모드를 누르면 다음과 같이 nodemon 이 시작되고

코드 변경 발생시

별도로 서버 시작 없이 변경된 내용기반으로 웹스톰이 디버깅 하는것을 볼수 있다.

엄한 삽질은 너무 많이 했네

 

참고 링크:

https://samkirkiles.svbtle.com/webstorm-node-js-debugging-with-nodemon

 

Webstorm Node.js debugging with Nodemon • Sam Kirkiles

I recently switched to the Webstorm IDE, and found that I couldn’t run the debugger when using nodemon to run my project. For those of you who haven’t tried nodemon, it’s a small package that automatically restarts your node project when it... | Sam

samkirkiles.svbtle.com

https://vcfvct.wordpress.com/2015/02/13/debug-nodejs-with-nodemon-and-intellij/

 

debug nodejs with nodemon and intellij

Noticed that if I run nodemon within intellij, I would not be able to debug any more inside intellij. Not sure what reason it is. If just run the nodejs, no problem. However once I add the ‘/…

vcfvct.wordpress.com

 

'코드 > Trouble Shoot' 카테고리의 다른 글

[JS] Cookie domain  (0) 2023.04.24
[Git] 전혀 다른 히스토리의 repository 푸시  (0) 2022.07.13
[Npm] premature close  (0) 2020.06.24
[JS] IOS 에서 다른 이미지 사이즈  (0) 2020.03.27
[Git] 브랜치 이름 변경하기  (0) 2020.03.24