如何更改 node.js 调试端口?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18910452/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-02 15:42:08  来源:igfitidea点击:

How to change node.js debug port?

node.jsdebugging

提问by IvanM

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

例如,如何将其从 5858 更改为 7000?

回答by Peter Lyons

You can use --debugoption:

您可以使用--debug选项:

node --debug=7000 app.js

You can use --inspectoption for latest node >= v8

您可以使用--inspect最新节点的选项 >= v8

node --inspect=7000 app.js

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

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

回答by V. Kovpak

For nodejs version >= v8 use this:

对于 nodejs 版本 >= v8 使用这个:

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

回答by Neophile

in unix command line just try this

在unix命令行中试试这个

 $ PORT=7000 node --debug app.js