简体   繁体   English

如何在Node.js上出错时自动暂停Visual Studio调试器?

[英]How to halt Visual Studio debugger automatically on error on Node.js?

I'm debugging Node.js application on Visual Studio 2015. It works great but there is one issue I find a big time-waster. 我正在调试Visual Studio 2015上的Node.js应用程序。它工作得很好,但有一个问题我发现很大的浪费时间。 If my program runs into an error I see the error on the console, but debugger does NOT stop where the error happened. 如果我的程序遇到错误,我在控制台上看到错误,但调试器不会停止发生错误的位置。 I have to look up the line-number from the console-log then locate that line in the source-code. 我必须从控制台日志中查找行号,然后在源代码中找到该行。

It works better when debugging browser-based JavaScript on Visual Studio, the debugger halts whenever an error is thrown, which is REALLY great. 在Visual Studio上调试基于浏览器的JavaScript时,它可以更好地工作,无论何时抛出错误,调试器都会停止,这非常棒。

Is it possible to get the Visual Studio debugger to halt when the debugged program running on Node.js throws an error? 当Node.js上运行的调试程序抛出错误时,是否可以让Visual Studio调试器暂停?

You could install the Node.js Tools for Visual Studio and use the Exception settings windows under Debug->Windows. 您可以为Visual Studio安装Node.js工具,并使用Debug-> Windows下的Exception设置窗口。 It would throw or catch the Exception. 它会抛出或捕获异常。

http://nodejstools.codeplex.com/discussions/538432 http://nodejstools.codeplex.com/discussions/538432

在此输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将Visual Studio代码调试器附加到在nginx代理后面的docker机器上运行的Node.JS应用程序 - How To Attach Visual Studio Code Debugger to Node.JS Application running on docker machine behind nginx proxy Node.js 错误 Visual Studio 代码中未找到模块错误 - Node.js error Module not found error in visual studio code Visual Studio代码node.js调试器无法在标准启动时附加 - visual studio code node.js debugger fails to attach on standard launch 通过node.js将Visual Studio调试器附加到电子边缘应用程序 - Attach Visual Studio debugger to an electron-edge app through node.js Visual Studio 2013和Node.js:停止打开Chrome调试器 - Visual Studio 2013 & Node.js: Stop debugger from opening chrome Visual Studio代码node.js调试:“连接失败”错误 - Visual Studio Code node.js debugging: “Connection failed” error Node.js Visual Studio 2013 - 路径太长错误 - Node.js Visual Studio 2013 - path too long error 如何在同一个Visual Studio项目中混合Node.js和Typescript? - How to mix Node.js and Typescript in the same Visual Studio project? 如何在Visual Studio Online中将node.js应用程序部署到Azure? - How to deploy a node.js app to Azure in Visual Studio Online? 如何配置Visual Studio Code以与Node.js一起使用 - How to configure Visual Studio Code to work with Node.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM