Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nodemon inspect/debug not working?

Running nodemon --inspect index.js or nodemon --debug index.js doesn't work.

Node Version : 8.9.1

Nodemon Version : 1.12.6

I have tried these with no luck :

  • nodemon --inspect-brk index.js

  • nodemon -- --inspect index.js

  • nodemon index.js -- --inspect index.js

  • nodemon index.js -- --debug index.js

  • nodemon -- --debug index.js

  • nodemon --inspect --debug index.js

  • nodemon --debug-brk index.js

But node --inspect index.js or node --inspect-brk index.js works. I wonder how? If any alternatives or some kinda workaround would be great too.

Please comment if you need further description.

like image 935
Pramesh Bajracharya Avatar asked Dec 13 '17 19:12

Pramesh Bajracharya


People also ask

What is Nodemon JSON?

nodemon supports local and global configuration files. These are named nodemon. json and can be located in the current working directory or in your home directory. The specificity is as follows, so that a command line argument will always override the config file settings: command line arguments.


2 Answers

For people coming from search engines, there could be a bug related to nodemon and ts-node.

Error: Unknown or unexpected option: --inspect 

This can be a way to use inspect with nodemon:

nodemon --exec 'node --inspect=0.0.0.0:9229 --require ts-node/register src/index.ts' 

For more information see here

like image 61
Sir hennihau Avatar answered Sep 30 '22 07:09

Sir hennihau


SOLVED,

It seems like [email protected] was not passing in this argument. There is a newer version available 1.12.7 where everything works fine and well.

Answer source: Nodemon Issues - Github

like image 31
Pramesh Bajracharya Avatar answered Sep 30 '22 09:09

Pramesh Bajracharya