1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Intellij/WebStormでts-nodeデバッグ設定

Last updated at Posted at 2019-10-24

デバッグ環境がわからなくなったのでメモ

Webアプリの起動ファイルはsrc/main.tsにしています。
node --inspect --require ts-node/register src/main.ts
nodemonを入れているなら

nodemon --inspect --require ts-node/register src/main.ts

これで

$ node --inspect --require ts-node/register src/main.ts
Debugger listening on ws://127.0.0.1:9229/977cea48-33da-4f31-86ad-9f7a465a4429
 
Server listening at port 3000

などと表示され、9229ポートでデバッガーが動くようです。

このあと、爆速で設定

Intellij/WebStormで

  1. 上部のパネルから'Edit Configuration'を選ぶ。

191024-0002.png

2.左にTemplatesの選択があるので、そこで"Attach to Node.js/Chrome"を選択

191024-0003.png

  1. このままの設定でOKなのでデバッグ設定に追加.

191024-0004.png

  • アプリを起動した状態でデバッガーボタン(虫の形ボタン)を押すと、Intellij上でブレークポイントが設定できデバッグできます。
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?