How to change node.js debug port?

node.jsDebugging

node.js Problem Overview


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

node.js Solutions


Solution 1 - node.js

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/

Solution 2 - node.js

For nodejs version >= v8 use this:

node --inspect=7000 --inspect-brk app.js

Solution 3 - node.js

in unix command line just try this

 $ PORT=7000 node --debug app.js

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionIvanMView Question on Stackoverflow
Solution 1 - node.jsPeter LyonsView Answer on Stackoverflow
Solution 2 - node.jscn007bView Answer on Stackoverflow
Solution 3 - node.jsNeophileView Answer on Stackoverflow