javascript Nodemon 检查/调试不起作用?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47800466/
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-10-29 07:36:01  来源:igfitidea点击:

Nodemon inspect/debug not working?

javascriptnode.jsdebuggingnodemon

提问by Pramesh Bajracharya

Running nodemon --inspect index.jsor nodemon --debug index.jsdoesn't work.

运行nodemon --inspect index.jsnodemon --debug index.js不工作。

Node Version : 8.9.1

节点版本:8.9.1

Nodemon Version : 1.12.6

Nodemon 版本: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

  • 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.jsor node --inspect-brk index.jsworks. I wonder how? If any alternatives or some kinda workaround would be great too.

但是node --inspect index.js还是node --inspect-brk index.js有效。我想知道如何?如果有任何替代方案或某种解决方法也会很棒。

Please comment if you need further description.

如果您需要进一步的描述,请发表评论。

回答by Pramesh Bajracharya

SOLVED,

解决了

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

似乎[email protected]没有通过这个论点。有一个更新的版本1.12.7,一切正常。

Answer source: Nodemon Issues - Github

答案来源:Nodemon 问题 - Github

回答by Charlie

nodemon --inspect app.js

The .js part is absolutely necessary.

.js 部分是绝对必要的。

回答by Nikhil Vats

As per official doc Nodemon NPM

根据官方文档Nodemon NPM

You can also pass the inspect flag to node through the command line as you would normally:

您还可以像往常一样通过命令行将检查标志传递给节点:

nodemon --inspect ./server.js 80

nodemon --inspect ./server.js 80