81

How to change it from 5858 to 7000, for example?

IvanM
  • 2,913
  • 2
  • 30
  • 30

2 Answers2

138

You can use --debug option:

node --debug=7000 app.js

You can use --inspect option for latest node >= v8

node --inspect=7000 app.js

https://nodejs.org/en/docs/inspector/

Theophilus Omoregbee
  • 2,463
  • 1
  • 22
  • 33
Peter Lyons
  • 142,938
  • 30
  • 279
  • 274
  • This is really useful when having Grunt run multiple concurrent tasks and still have them all debug simultaneously. – Venning Apr 10 '14 at 19:14
  • 1
    The same syntax applies to nodemon as it passes the param through to node. – Synchro Sep 22 '15 at 09:40
8

For nodejs version >= v8 use this:

node --inspect=7000 --inspect-brk app.js
cn007b
  • 16,596
  • 7
  • 59
  • 74