Nodemon inspect/debug not working?

30,383

Solution 1

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

Solution 2

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

Solution 3

nodemon --inspect app.js

The .js part is absolutely necessary.

Solution 4

FINALLY SOLVED

Just follow the below steps are you're good to go:

  1. Make sure you have updated version of nodemon. Update is using following command: npm i [email protected] -g. Make sure to use -g(to give nodemon permissions to run as an administrator). If you get some warnings, try running the same with sudo command sudo npm i [email protected] -g

  2. Then execute the command as: nodemon --inspect app.js

I hope it helped..!!

Share:
30,383
Pramesh Bajracharya
Author by

Pramesh Bajracharya

I'm a Software Engineer. Full Stack Developer with some machine learning skills. Working with: JavaScript Python Java

Updated on July 29, 2020

Comments

  • Pramesh Bajracharya
    Pramesh Bajracharya almost 4 years

    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.